forked from netcommons/NetCommons2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdate.class.php
More file actions
55 lines (51 loc) · 1.29 KB
/
Update.class.php
File metadata and controls
55 lines (51 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* 会員管理アップデートクラス
*
* @package NetCommons.components
* @author Noriko Arai,Ryuji Masukawa
* @copyright 2006-2007 NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @project NetCommons Project, supported by National Institute of Informatics
* @access public
*/
class Room_Update extends Action
{
//使用コンポーネントを受け取るため
var $db = null;
var $pagesAction = null;
function execute()
{
$sql = "SELECT P.room_id, "
. "MAX(PU.role_authority_id) M "
. "FROM {pages} P "
. "LEFT JOIN {pages_users_link} PU "
. "ON P.room_id = PU.room_id "
. "WHERE (P.space_type = ? "
. "OR P.space_type = ?) "
. "AND P.private_flag = ? "
. "AND P.thread_num = ? "
. "GROUP BY P.room_id "
. "HAVING (M = ? "
. "OR M IS NULL)";
$bindValues = array(
_SPACE_TYPE_PUBLIC,
_SPACE_TYPE_GROUP,
_OFF,
1,
0
);
$garbages = $this->db->execute($sql, $bindValues);
if ($garbages === false) {
$this->db->addError();
return false;
}
foreach ($garbages as $garbage) {
if (!$this->pagesAction->deleteRoom($garbage['room_id'])) {
return false;
}
}
return true;
}
}
?>