@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if(IN_MANAGER_MODE!="true") { |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | /** |
5 | 7 | * Secure Web Documents |
@@ -10,7 +12,8 @@ discard block |
||
10 | 12 | * |
11 | 13 | */ |
12 | 14 | |
13 | -function secureWebDocument($docid='') { |
|
15 | +function secureWebDocument($docid='') |
|
16 | +{ |
|
14 | 17 | global $modx; |
15 | 18 | |
16 | 19 | $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privateweb = 1")); |
@@ -11,18 +11,18 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | function secureWebDocument($docid='') { |
14 | - global $modx; |
|
14 | + global $modx; |
|
15 | 15 | |
16 | - $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privateweb = 1")); |
|
17 | - $rs = $modx->db->select( |
|
18 | - 'DISTINCT sc.id', |
|
19 | - $modx->getFullTableName("site_content")." sc |
|
16 | + $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privateweb = 1")); |
|
17 | + $rs = $modx->db->select( |
|
18 | + 'DISTINCT sc.id', |
|
19 | + $modx->getFullTableName("site_content")." sc |
|
20 | 20 | LEFT JOIN ".$modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
21 | 21 | LEFT JOIN ".$modx->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group", |
22 | - ($docid>0 ? " sc.id='{$docid}' AND ":"")."wga.id>0" |
|
23 | - ); |
|
24 | - $ids = $modx->db->getColumn("id",$rs); |
|
25 | - if(count($ids)>0) { |
|
26 | - $modx->db->update('privateweb = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); |
|
27 | - } |
|
22 | + ($docid>0 ? " sc.id='{$docid}' AND ":"")."wga.id>0" |
|
23 | + ); |
|
24 | + $ids = $modx->db->getColumn("id",$rs); |
|
25 | + if(count($ids)>0) { |
|
26 | + $modx->db->update('privateweb = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); |
|
27 | + } |
|
28 | 28 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Secure Web Documents |
@@ -10,19 +10,19 @@ discard block |
||
10 | 10 | * |
11 | 11 | */ |
12 | 12 | |
13 | -function secureWebDocument($docid='') { |
|
13 | +function secureWebDocument($docid = ''){ |
|
14 | 14 | global $modx; |
15 | 15 | |
16 | - $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privateweb = 1")); |
|
16 | + $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid > 0 ? "id='$docid'" : "privateweb = 1")); |
|
17 | 17 | $rs = $modx->db->select( |
18 | 18 | 'DISTINCT sc.id', |
19 | 19 | $modx->getFullTableName("site_content")." sc |
20 | 20 | LEFT JOIN ".$modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
21 | 21 | LEFT JOIN ".$modx->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group", |
22 | - ($docid>0 ? " sc.id='{$docid}' AND ":"")."wga.id>0" |
|
22 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."wga.id>0" |
|
23 | 23 | ); |
24 | - $ids = $modx->db->getColumn("id",$rs); |
|
25 | - if(count($ids)>0) { |
|
26 | - $modx->db->update('privateweb = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); |
|
24 | + $ids = $modx->db->getColumn("id", $rs); |
|
25 | + if (count($ids) > 0) { |
|
26 | + $modx->db->update('privateweb = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ", $ids).")"); |
|
27 | 27 | } |
28 | 28 | } |
@@ -65,26 +65,26 @@ |
||
65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
67 | 67 | |
68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
68 | +if ($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
69 | +elseif ($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
70 | +elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
71 | +elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
72 | +elseif ($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
73 | +elseif ($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
74 | +elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
75 | +elseif ($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
76 | +elseif ($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
77 | +elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
78 | +elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
79 | +elseif ($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
80 | +elseif ($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
81 | +elseif ($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
82 | +elseif ($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
83 | 83 | |
84 | 84 | $tpl = '<option value="%s" %s>%s</option>'; |
85 | 85 | $options = array(); |
86 | -foreach($_ as $value=>$label) { |
|
87 | - $selected = $value===$modx_charset ? 'selected' : ''; |
|
86 | +foreach ($_ as $value=>$label) { |
|
87 | + $selected = $value === $modx_charset ? 'selected' : ''; |
|
88 | 88 | $options[] = sprintf($tpl, $value, $selected, $label); |
89 | 89 | } |
90 | 90 | echo join("\n", $options); |
@@ -65,21 +65,37 @@ |
||
65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
67 | 67 | |
68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
68 | +if($modx_charset == 'euc-jp') { |
|
69 | + $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
70 | +} elseif($modx_charset == 'shift_jis') { |
|
71 | + $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
72 | +} elseif($modx_charset == 'iso-2022-jp') { |
|
73 | + $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
74 | +} elseif($modx_charset == 'csISO2022JP') { |
|
75 | + $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
76 | +} elseif($modx_charset == 'EUC-CN') { |
|
77 | + $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
78 | +} elseif($modx_charset == 'hz-gb-2312') { |
|
79 | + $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
80 | +} elseif($modx_charset == 'x-mac-chinesesimp') { |
|
81 | + $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
82 | +} elseif($modx_charset == 'x-Chinese-CNS') { |
|
83 | + $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
84 | +} elseif($modx_charset == 'x-Chinese-Eten') { |
|
85 | + $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
86 | +} elseif($modx_charset == 'x-mac-chinesetrad') { |
|
87 | + $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
88 | +} elseif($modx_charset == 'ks_c_5601-1987') { |
|
89 | + $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
90 | +} elseif($modx_charset == 'euc-kr') { |
|
91 | + $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
92 | +} elseif($modx_charset == 'iso-2022-kr') { |
|
93 | + $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
94 | +} elseif($modx_charset == 'Johab') { |
|
95 | + $_['Johab'] = 'Korean (Johab) - Johab'; |
|
96 | +} elseif($modx_charset == 'x-mac-korean') { |
|
97 | + $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
98 | +} |
|
83 | 99 | |
84 | 100 | $tpl = '<option value="%s" %s>%s</option>'; |
85 | 101 | $options = array(); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | if($emptyCache) { |
54 | - $modx->clearCache('full'); |
|
54 | + $modx->clearCache('full'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | echo $str; |
58 | 58 | \ No newline at end of file |
@@ -3,9 +3,9 @@ discard block |
||
3 | 3 | * mutate_settings.ajax.php |
4 | 4 | * |
5 | 5 | */ |
6 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
6 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
7 | 7 | |
8 | -require_once(dirname(__FILE__) . '/protect.inc.php'); |
|
8 | +require_once(dirname(__FILE__).'/protect.inc.php'); |
|
9 | 9 | |
10 | 10 | $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']); |
11 | 11 | $lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']); |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | $str = ''; |
21 | 21 | $emptyCache = false; |
22 | 22 | |
23 | -switch(true){ |
|
24 | - case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{ |
|
25 | - include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php'); |
|
26 | - $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ; |
|
23 | +switch (true) { |
|
24 | + case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/', $lang) && file_exists(dirname(__FILE__).'/lang/'.$lang.'.inc.php')):{ |
|
25 | + include(dirname(__FILE__).'/lang/'.$lang.'.inc.php'); |
|
26 | + $str = isset($key, $_lang, $_lang[$key]) ? $_lang[$key] : ""; |
|
27 | 27 | break; |
28 | 28 | } |
29 | 29 | case ($action == 'setsetting' && !empty($key) && !empty($value)):{ |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | -if($emptyCache) { |
|
53 | +if ($emptyCache) { |
|
54 | 54 | $modx->clearCache('full'); |
55 | 55 | } |
56 | 56 |
@@ -3,7 +3,9 @@ discard block |
||
3 | 3 | * mutate_settings.ajax.php |
4 | 4 | * |
5 | 5 | */ |
6 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
6 | +if(IN_MANAGER_MODE!="true") { |
|
7 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
8 | +} |
|
7 | 9 | |
8 | 10 | require_once(dirname(__FILE__) . '/protect.inc.php'); |
9 | 11 | |
@@ -20,7 +22,7 @@ discard block |
||
20 | 22 | $str = ''; |
21 | 23 | $emptyCache = false; |
22 | 24 | |
23 | -switch(true){ |
|
25 | +switch(true) { |
|
24 | 26 | case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{ |
25 | 27 | include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php'); |
26 | 28 | $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ; |
@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | global $site_sessionname; |
4 | 4 | $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession |
5 | 5 | |
6 | -function genEvoSessionName() { |
|
6 | +function genEvoSessionName(){ |
|
7 | 7 | $_ = crc32(__FILE__); |
8 | 8 | $_ = sprintf('%u', $_); |
9 | - return 'evo' . base_convert($_,10,36); |
|
9 | + return 'evo'.base_convert($_, 10, 36); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | function startCMSSession(){ |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | session_name($site_sessionname); |
17 | 17 | removeInvalidCmsSessionIds($site_sessionname); |
18 | - $cookieExpiration= 0; |
|
18 | + $cookieExpiration = 0; |
|
19 | 19 | $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); |
20 | 20 | $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; |
21 | 21 | $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | $key = "modx.{$context}.session.cookie.lifetime"; |
26 | 26 | if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
27 | - $cookieLifetime= intval($_SESSION[$key]); |
|
28 | - if($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime; |
|
27 | + $cookieLifetime = intval($_SESSION[$key]); |
|
28 | + if ($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; |
|
29 | 29 | setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
30 | 30 | } |
31 | 31 | if (!isset($_SESSION['modx.session.created.time'])) { |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -function removeInvalidCmsSessionFromStorage(&$storage, $session_name) { |
|
36 | +function removeInvalidCmsSessionFromStorage(&$storage, $session_name){ |
|
37 | 37 | if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) |
38 | 38 | { |
39 | 39 | unset($storage[$session_name]); |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | -function removeInvalidCmsSessionIds($session_name) { |
|
43 | +function removeInvalidCmsSessionIds($session_name){ |
|
44 | 44 | // session ids is invalid iff it is empty string |
45 | 45 | // storage priorioty can see in PHP source ext/session/session.c |
46 | 46 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |
@@ -3,13 +3,15 @@ discard block |
||
3 | 3 | global $site_sessionname; |
4 | 4 | $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession |
5 | 5 | |
6 | -function genEvoSessionName() { |
|
6 | +function genEvoSessionName() |
|
7 | +{ |
|
7 | 8 | $_ = crc32(__FILE__); |
8 | 9 | $_ = sprintf('%u', $_); |
9 | 10 | return 'evo' . base_convert($_,10,36); |
10 | 11 | } |
11 | 12 | |
12 | -function startCMSSession(){ |
|
13 | +function startCMSSession() |
|
14 | +{ |
|
13 | 15 | |
14 | 16 | global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; |
15 | 17 | |
@@ -23,24 +25,27 @@ discard block |
||
23 | 25 | session_start(); |
24 | 26 | |
25 | 27 | $key = "modx.{$context}.session.cookie.lifetime"; |
26 | - if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
|
28 | + if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
|
27 | 29 | $cookieLifetime= intval($_SESSION[$key]); |
28 | - if($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime; |
|
30 | + if($cookieLifetime) { |
|
31 | + $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime; |
|
32 | + } |
|
29 | 33 | setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
30 | 34 | } |
31 | - if (!isset($_SESSION['modx.session.created.time'])) { |
|
35 | + if (!isset($_SESSION['modx.session.created.time'])) { |
|
32 | 36 | $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME']; |
33 | 37 | } |
34 | 38 | } |
35 | 39 | |
36 | -function removeInvalidCmsSessionFromStorage(&$storage, $session_name) { |
|
37 | - if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) |
|
38 | - { |
|
40 | +function removeInvalidCmsSessionFromStorage(&$storage, $session_name) |
|
41 | +{ |
|
42 | + if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) { |
|
39 | 43 | unset($storage[$session_name]); |
40 | 44 | } |
41 | 45 | } |
42 | 46 | |
43 | -function removeInvalidCmsSessionIds($session_name) { |
|
47 | +function removeInvalidCmsSessionIds($session_name) |
|
48 | +{ |
|
44 | 49 | // session ids is invalid iff it is empty string |
45 | 50 | // storage priorioty can see in PHP source ext/session/session.c |
46 | 51 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." AND messageread=0"); |
5 | 5 | $nrnewmessages = $modx->db->getValue($rs); |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if(IN_MANAGER_MODE!="true") { |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." AND messageread=0"); |
5 | 7 | $nrnewmessages = $modx->db->getValue($rs); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | // ajax response |
11 | 11 | if (isset($_POST['updateMsgCount'])) { |
12 | - header("Content-Type: application/json; charset=utf-8"); |
|
13 | - print $nrnewmessages.','.$nrtotalmessages; |
|
14 | - exit; |
|
12 | + header("Content-Type: application/json; charset=utf-8"); |
|
13 | + print $nrnewmessages.','.$nrtotalmessages; |
|
14 | + exit; |
|
15 | 15 | } |
@@ -5,72 +5,72 @@ discard block |
||
5 | 5 | var $errorcode; |
6 | 6 | var $errors = array(); |
7 | 7 | |
8 | - function __construct() { |
|
8 | + function __construct() { |
|
9 | 9 | |
10 | - $_lang = $this->include_lang('errormsg'); |
|
10 | + $_lang = $this->include_lang('errormsg'); |
|
11 | 11 | |
12 | - $this->errors = array( |
|
13 | - 0 => $_lang["No errors occured."], |
|
14 | - 1 => $_lang["An error occured!"], |
|
15 | - 2 => $_lang["Document's ID not passed in request!"], |
|
16 | - 3 => $_lang["You don't have enough privileges for this action!"], |
|
17 | - 4 => $_lang["ID passed in request is NaN!"], |
|
18 | - 5 => $_lang["The document is locked!"], |
|
19 | - 6 => $_lang["Too many results returned from database!"], |
|
20 | - 7 => $_lang["Not enough/ no results returned from database!"], |
|
21 | - 8 => $_lang["Couldn't find parent document's name!"], |
|
22 | - 9 => $_lang["Logging error!"], |
|
23 | - 10 => $_lang["Table to optimise not found in request!"], |
|
24 | - 11 => $_lang["No settings found in request!"], |
|
25 | - 12 => $_lang["The document must have a title!"], |
|
26 | - 13 => $_lang["No user selected as recipient of this message!"], |
|
27 | - 14 => $_lang["No group selected as recipient of this message!"], |
|
28 | - 15 => $_lang["The document was not found!"], |
|
12 | + $this->errors = array( |
|
13 | + 0 => $_lang["No errors occured."], |
|
14 | + 1 => $_lang["An error occured!"], |
|
15 | + 2 => $_lang["Document's ID not passed in request!"], |
|
16 | + 3 => $_lang["You don't have enough privileges for this action!"], |
|
17 | + 4 => $_lang["ID passed in request is NaN!"], |
|
18 | + 5 => $_lang["The document is locked!"], |
|
19 | + 6 => $_lang["Too many results returned from database!"], |
|
20 | + 7 => $_lang["Not enough/ no results returned from database!"], |
|
21 | + 8 => $_lang["Couldn't find parent document's name!"], |
|
22 | + 9 => $_lang["Logging error!"], |
|
23 | + 10 => $_lang["Table to optimise not found in request!"], |
|
24 | + 11 => $_lang["No settings found in request!"], |
|
25 | + 12 => $_lang["The document must have a title!"], |
|
26 | + 13 => $_lang["No user selected as recipient of this message!"], |
|
27 | + 14 => $_lang["No group selected as recipient of this message!"], |
|
28 | + 15 => $_lang["The document was not found!"], |
|
29 | 29 | |
30 | - 100 => $_lang["Double action (GET & POST) posted!"], |
|
31 | - 600 => $_lang["Document cannot be it's own parent!"], |
|
32 | - 601 => $_lang["Document's ID not passed in request!"], |
|
33 | - 602 => $_lang["New parent not set in request!"], |
|
34 | - 900 => $_lang["don't know the user!"], // don't know the user! |
|
35 | - 901 => $_lang["wrong password!"], // wrong password! |
|
36 | - 902 => $_lang["Due to too many failed logins, you have been blocked!"], |
|
37 | - 903 => $_lang["You are blocked and cannot log in!"], |
|
38 | - 904 => $_lang["You are blocked and cannot log in! Please try again later."], |
|
39 | - 905 => $_lang["The security code you entered didn't validate! Please try to login again!"] |
|
40 | - ); |
|
41 | - } |
|
30 | + 100 => $_lang["Double action (GET & POST) posted!"], |
|
31 | + 600 => $_lang["Document cannot be it's own parent!"], |
|
32 | + 601 => $_lang["Document's ID not passed in request!"], |
|
33 | + 602 => $_lang["New parent not set in request!"], |
|
34 | + 900 => $_lang["don't know the user!"], // don't know the user! |
|
35 | + 901 => $_lang["wrong password!"], // wrong password! |
|
36 | + 902 => $_lang["Due to too many failed logins, you have been blocked!"], |
|
37 | + 903 => $_lang["You are blocked and cannot log in!"], |
|
38 | + 904 => $_lang["You are blocked and cannot log in! Please try again later."], |
|
39 | + 905 => $_lang["The security code you entered didn't validate! Please try to login again!"] |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | |
43 | - function include_lang($context='common') { |
|
44 | - global $modx; |
|
45 | - $_lang = array(); |
|
43 | + function include_lang($context='common') { |
|
44 | + global $modx; |
|
45 | + $_lang = array(); |
|
46 | 46 | |
47 | - $context = trim($context,'/'); |
|
48 | - if(strpos($context,'..')!==false) return; |
|
47 | + $context = trim($context,'/'); |
|
48 | + if(strpos($context,'..')!==false) return; |
|
49 | 49 | |
50 | - if($context === 'common') |
|
51 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
52 | - else |
|
53 | - $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
54 | - include_once($lang_path . 'english.inc.php'); |
|
55 | - $manager_language = $modx->config['manager_language']; |
|
56 | - if(is_file("{$lang_path}{$manager_language}.inc.php")) |
|
57 | - include_once("{$lang_path}{$manager_language}.inc.php"); |
|
58 | - return $_lang; |
|
59 | - } |
|
50 | + if($context === 'common') |
|
51 | + $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
52 | + else |
|
53 | + $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
54 | + include_once($lang_path . 'english.inc.php'); |
|
55 | + $manager_language = $modx->config['manager_language']; |
|
56 | + if(is_file("{$lang_path}{$manager_language}.inc.php")) |
|
57 | + include_once("{$lang_path}{$manager_language}.inc.php"); |
|
58 | + return $_lang; |
|
59 | + } |
|
60 | 60 | |
61 | - function setError($errorcode, $custommessage=""){ |
|
62 | - $this->errorcode=$errorcode; |
|
63 | - $this->errormessage=$this->errors[$errorcode]; |
|
64 | - if($custommessage!="") { |
|
65 | - $this->errormessage=$custommessage; |
|
66 | - } |
|
67 | - } |
|
61 | + function setError($errorcode, $custommessage=""){ |
|
62 | + $this->errorcode=$errorcode; |
|
63 | + $this->errormessage=$this->errors[$errorcode]; |
|
64 | + if($custommessage!="") { |
|
65 | + $this->errormessage=$custommessage; |
|
66 | + } |
|
67 | + } |
|
68 | 68 | |
69 | - function getError() { |
|
70 | - return $this->errorcode; |
|
71 | - } |
|
69 | + function getError() { |
|
70 | + return $this->errorcode; |
|
71 | + } |
|
72 | 72 | |
73 | - function dumpError(){ |
|
73 | + function dumpError(){ |
|
74 | 74 | ?> |
75 | 75 | <html> |
76 | 76 | <head> |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | </body> |
89 | 89 | </html> |
90 | 90 | <?php |
91 | - exit; |
|
92 | - } |
|
91 | + exit; |
|
92 | + } |
|
93 | 93 | } |
94 | 94 | ?> |
95 | 95 | \ No newline at end of file |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | var $errorcode; |
6 | 6 | var $errors = array(); |
7 | 7 | |
8 | - function __construct() { |
|
8 | + function __construct(){ |
|
9 | 9 | |
10 | 10 | $_lang = $this->include_lang('errormsg'); |
11 | 11 | |
@@ -40,33 +40,33 @@ discard block |
||
40 | 40 | ); |
41 | 41 | } |
42 | 42 | |
43 | - function include_lang($context='common') { |
|
43 | + function include_lang($context = 'common'){ |
|
44 | 44 | global $modx; |
45 | 45 | $_lang = array(); |
46 | 46 | |
47 | - $context = trim($context,'/'); |
|
48 | - if(strpos($context,'..')!==false) return; |
|
47 | + $context = trim($context, '/'); |
|
48 | + if (strpos($context, '..') !== false) return; |
|
49 | 49 | |
50 | - if($context === 'common') |
|
51 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
50 | + if ($context === 'common') |
|
51 | + $lang_path = MODX_MANAGER_PATH.'includes/lang/'; |
|
52 | 52 | else |
53 | - $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
54 | - include_once($lang_path . 'english.inc.php'); |
|
53 | + $lang_path = MODX_MANAGER_PATH."includes/lang/{$context}/"; |
|
54 | + include_once($lang_path.'english.inc.php'); |
|
55 | 55 | $manager_language = $modx->config['manager_language']; |
56 | - if(is_file("{$lang_path}{$manager_language}.inc.php")) |
|
56 | + if (is_file("{$lang_path}{$manager_language}.inc.php")) |
|
57 | 57 | include_once("{$lang_path}{$manager_language}.inc.php"); |
58 | 58 | return $_lang; |
59 | 59 | } |
60 | 60 | |
61 | - function setError($errorcode, $custommessage=""){ |
|
62 | - $this->errorcode=$errorcode; |
|
63 | - $this->errormessage=$this->errors[$errorcode]; |
|
64 | - if($custommessage!="") { |
|
65 | - $this->errormessage=$custommessage; |
|
61 | + function setError($errorcode, $custommessage = ""){ |
|
62 | + $this->errorcode = $errorcode; |
|
63 | + $this->errormessage = $this->errors[$errorcode]; |
|
64 | + if ($custommessage != "") { |
|
65 | + $this->errormessage = $custommessage; |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - function getError() { |
|
69 | + function getError(){ |
|
70 | 70 | return $this->errorcode; |
71 | 71 | } |
72 | 72 |
@@ -1,11 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // this is the old error handler. Here for legacy, until i replace all the old errors. |
3 | -class errorHandler{ |
|
3 | +class errorHandler |
|
4 | +{ |
|
4 | 5 | |
5 | 6 | var $errorcode; |
6 | 7 | var $errors = array(); |
7 | 8 | |
8 | - function __construct() { |
|
9 | + function __construct() |
|
10 | + { |
|
9 | 11 | |
10 | 12 | $_lang = $this->include_lang('errormsg'); |
11 | 13 | |
@@ -40,25 +42,31 @@ discard block |
||
40 | 42 | ); |
41 | 43 | } |
42 | 44 | |
43 | - function include_lang($context='common') { |
|
45 | + function include_lang($context='common') |
|
46 | + { |
|
44 | 47 | global $modx; |
45 | 48 | $_lang = array(); |
46 | 49 | |
47 | 50 | $context = trim($context,'/'); |
48 | - if(strpos($context,'..')!==false) return; |
|
51 | + if(strpos($context,'..')!==false) { |
|
52 | + return; |
|
53 | + } |
|
49 | 54 | |
50 | - if($context === 'common') |
|
51 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
52 | - else |
|
53 | - $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
55 | + if($context === 'common') { |
|
56 | + $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
57 | + } else { |
|
58 | + $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
59 | + } |
|
54 | 60 | include_once($lang_path . 'english.inc.php'); |
55 | 61 | $manager_language = $modx->config['manager_language']; |
56 | - if(is_file("{$lang_path}{$manager_language}.inc.php")) |
|
57 | - include_once("{$lang_path}{$manager_language}.inc.php"); |
|
62 | + if(is_file("{$lang_path}{$manager_language}.inc.php")) { |
|
63 | + include_once("{$lang_path}{$manager_language}.inc.php"); |
|
64 | + } |
|
58 | 65 | return $_lang; |
59 | 66 | } |
60 | 67 | |
61 | - function setError($errorcode, $custommessage=""){ |
|
68 | + function setError($errorcode, $custommessage="") |
|
69 | + { |
|
62 | 70 | $this->errorcode=$errorcode; |
63 | 71 | $this->errormessage=$this->errors[$errorcode]; |
64 | 72 | if($custommessage!="") { |
@@ -66,11 +74,13 @@ discard block |
||
66 | 74 | } |
67 | 75 | } |
68 | 76 | |
69 | - function getError() { |
|
77 | + function getError() |
|
78 | + { |
|
70 | 79 | return $this->errorcode; |
71 | 80 | } |
72 | 81 | |
73 | - function dumpError(){ |
|
82 | + function dumpError() |
|
83 | + { |
|
74 | 84 | ?> |
75 | 85 | <html> |
76 | 86 | <head> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | // START HACK |
5 | 5 | if (isset ($modx)) { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | $which_browser_default = $which_browser; |
17 | 17 | while ($row = $modx->db->getRow($rs)) { |
18 | - if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') $row['setting_value'] = $which_browser_default; |
|
18 | + if ($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') $row['setting_value'] = $which_browser_default; |
|
19 | 19 | $settings[$row['setting_name']] = $row['setting_value']; |
20 | 20 | if (isset($modx->config)) { |
21 | 21 | $modx->config[$row['setting_name']] = $row['setting_value']; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if(IN_MANAGER_MODE!="true") { |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | // START HACK |
5 | 7 | if (isset ($modx)) { |
@@ -15,7 +17,9 @@ discard block |
||
15 | 17 | |
16 | 18 | $which_browser_default = $which_browser; |
17 | 19 | while ($row = $modx->db->getRow($rs)) { |
18 | - if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') $row['setting_value'] = $which_browser_default; |
|
20 | + if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') { |
|
21 | + $row['setting_value'] = $which_browser_default; |
|
22 | + } |
|
19 | 23 | $settings[$row['setting_name']] = $row['setting_value']; |
20 | 24 | if (isset($modx->config)) { |
21 | 25 | $modx->config[$row['setting_name']] = $row['setting_value']; |
@@ -3,23 +3,23 @@ |
||
3 | 3 | |
4 | 4 | // START HACK |
5 | 5 | if (isset ($modx)) { |
6 | - $user_id = $modx->getLoginUserID(); |
|
6 | + $user_id = $modx->getLoginUserID(); |
|
7 | 7 | } else { |
8 | - $user_id = $_SESSION['mgrInternalKey']; |
|
8 | + $user_id = $_SESSION['mgrInternalKey']; |
|
9 | 9 | } |
10 | 10 | // END HACK |
11 | 11 | |
12 | 12 | if (!empty($user_id)) { |
13 | - // Raymond: grab the user settings from the database. |
|
14 | - $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('user_settings'), "user=".$modx->getLoginUserID()); |
|
13 | + // Raymond: grab the user settings from the database. |
|
14 | + $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('user_settings'), "user=".$modx->getLoginUserID()); |
|
15 | 15 | |
16 | - $which_browser_default = $which_browser; |
|
17 | - while ($row = $modx->db->getRow($rs)) { |
|
18 | - if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') $row['setting_value'] = $which_browser_default; |
|
19 | - $settings[$row['setting_name']] = $row['setting_value']; |
|
20 | - if (isset($modx->config)) { |
|
21 | - $modx->config[$row['setting_name']] = $row['setting_value']; |
|
22 | - } |
|
23 | - } |
|
24 | - extract($settings, EXTR_OVERWRITE); |
|
16 | + $which_browser_default = $which_browser; |
|
17 | + while ($row = $modx->db->getRow($rs)) { |
|
18 | + if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') $row['setting_value'] = $which_browser_default; |
|
19 | + $settings[$row['setting_name']] = $row['setting_value']; |
|
20 | + if (isset($modx->config)) { |
|
21 | + $modx->config[$row['setting_name']] = $row['setting_value']; |
|
22 | + } |
|
23 | + } |
|
24 | + extract($settings, EXTR_OVERWRITE); |
|
25 | 25 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | var stay = document.getElementById('stay'); |
19 | 19 | // Trigger unlock |
20 | 20 | if ((stay && stay.value !== '2') || !form_save) { |
21 | - var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random(); |
|
21 | + var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType; ?>&id=<?php echo $lockElementId; ?>&o=' + Math.random(); |
|
22 | 22 | if (navigator.sendBeacon) { |
23 | 23 | navigator.sendBeacon(url) |
24 | 24 | } else { |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if(IN_MANAGER_MODE!="true") { |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | /** |
5 | 7 | * Secure Manager Documents |
@@ -10,7 +12,8 @@ discard block |
||
10 | 12 | * |
11 | 13 | */ |
12 | 14 | |
13 | -function secureMgrDocument($docid='') { |
|
15 | +function secureMgrDocument($docid='') |
|
16 | +{ |
|
14 | 17 | global $modx; |
15 | 18 | |
16 | 19 | $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privatemgr = 1")); |
@@ -11,18 +11,18 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | function secureMgrDocument($docid='') { |
14 | - global $modx; |
|
14 | + global $modx; |
|
15 | 15 | |
16 | - $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privatemgr = 1")); |
|
17 | - $rs = $modx->db->select( |
|
18 | - 'DISTINCT sc.id', |
|
19 | - $modx->getFullTableName("site_content")." sc |
|
16 | + $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privatemgr = 1")); |
|
17 | + $rs = $modx->db->select( |
|
18 | + 'DISTINCT sc.id', |
|
19 | + $modx->getFullTableName("site_content")." sc |
|
20 | 20 | LEFT JOIN ".$modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
21 | 21 | LEFT JOIN ".$modx->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group", |
22 | - ($docid>0 ? " sc.id='{$docid}' AND ":"")."mga.id>0" |
|
23 | - ); |
|
24 | - $ids = $modx->db->getColumn("id",$rs); |
|
25 | - if(count($ids)>0) { |
|
26 | - $modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); |
|
27 | - } |
|
22 | + ($docid>0 ? " sc.id='{$docid}' AND ":"")."mga.id>0" |
|
23 | + ); |
|
24 | + $ids = $modx->db->getColumn("id",$rs); |
|
25 | + if(count($ids)>0) { |
|
26 | + $modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); |
|
27 | + } |
|
28 | 28 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Secure Manager Documents |
@@ -10,19 +10,19 @@ discard block |
||
10 | 10 | * |
11 | 11 | */ |
12 | 12 | |
13 | -function secureMgrDocument($docid='') { |
|
13 | +function secureMgrDocument($docid = ''){ |
|
14 | 14 | global $modx; |
15 | 15 | |
16 | - $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privatemgr = 1")); |
|
16 | + $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid > 0 ? "id='$docid'" : "privatemgr = 1")); |
|
17 | 17 | $rs = $modx->db->select( |
18 | 18 | 'DISTINCT sc.id', |
19 | 19 | $modx->getFullTableName("site_content")." sc |
20 | 20 | LEFT JOIN ".$modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
21 | 21 | LEFT JOIN ".$modx->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group", |
22 | - ($docid>0 ? " sc.id='{$docid}' AND ":"")."mga.id>0" |
|
22 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."mga.id>0" |
|
23 | 23 | ); |
24 | - $ids = $modx->db->getColumn("id",$rs); |
|
25 | - if(count($ids)>0) { |
|
26 | - $modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); |
|
24 | + $ids = $modx->db->getColumn("id", $rs); |
|
25 | + if (count($ids) > 0) { |
|
26 | + $modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ", $ids).")"); |
|
27 | 27 | } |
28 | 28 | } |