@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || 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."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('view_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // get id |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | <div class="tab-page"> |
42 | 42 | <div class="container container-body"> |
43 | 43 | <?php |
44 | - $date = $modx->toDateFormat($content["createdon"]); |
|
45 | - if($content["type"] == 1) { |
|
46 | - $icon = $_style['actions_info'] . ' text-info'; |
|
47 | - $msgtype = $_lang["information"]; |
|
48 | - } else if($content["type"] == 2) { |
|
49 | - $icon = $_style['actions_triangle'] . ' text-warning'; |
|
50 | - $msgtype = $_lang["warning"]; |
|
51 | - } else if($content["type"] == 3) { |
|
52 | - $icon = $_style['actions_error'] . ' text-danger'; |
|
53 | - $msgtype = $_lang["error"]; |
|
54 | - } |
|
55 | - ?> |
|
44 | + $date = $modx->toDateFormat($content["createdon"]); |
|
45 | + if($content["type"] == 1) { |
|
46 | + $icon = $_style['actions_info'] . ' text-info'; |
|
47 | + $msgtype = $_lang["information"]; |
|
48 | + } else if($content["type"] == 2) { |
|
49 | + $icon = $_style['actions_triangle'] . ' text-warning'; |
|
50 | + $msgtype = $_lang["warning"]; |
|
51 | + } else if($content["type"] == 3) { |
|
52 | + $icon = $_style['actions_error'] . ' text-danger'; |
|
53 | + $msgtype = $_lang["error"]; |
|
54 | + } |
|
55 | + ?> |
|
56 | 56 | <p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p> |
57 | 57 | <p> |
58 | 58 | <i class="<?= $icon ?>"></i> <?= $msgtype ?> |
@@ -5,140 +5,140 @@ |
||
5 | 5 | |
6 | 6 | // action list |
7 | 7 | $GLOBALS['action_list'] = array( |
8 | - '1' => 'Loading a frame(set)', |
|
9 | - '2' => 'Viewing home page/ online users', |
|
10 | - '3' => 'Viewing data for resource', |
|
11 | - '4' => 'Creating a resource', |
|
12 | - '5' => 'Saving resource', |
|
13 | - '6' => 'Deleting resource', |
|
14 | - '7' => 'Waiting while MODX cleans up', |
|
15 | - '8' => 'Logged out', |
|
16 | - '9' => 'Viewing help', |
|
17 | - '10' => 'Viewing/ composing messages', |
|
18 | - '11' => 'Creating a user', |
|
19 | - '12' => 'Editing user', |
|
20 | - '13' => 'Viewing logging', |
|
21 | - '14' => 'Editing a parser', |
|
22 | - '15' => 'Saving a parser', |
|
23 | - '16' => 'Editing template', |
|
24 | - '17' => 'Editing settings', |
|
25 | - '18' => 'Viewing Credits :)', |
|
26 | - '19' => 'Creating a new template', |
|
27 | - '20' => 'Saving template', |
|
28 | - '21' => 'Deleting template', |
|
29 | - '22' => 'Editing Snippet', |
|
30 | - '23' => 'Creating a new Snippet', |
|
31 | - '24' => 'Saving Snippet', |
|
32 | - '25' => 'Deleting Snippet', |
|
33 | - '26' => 'Refreshing site', |
|
34 | - '27' => 'Editing resource', |
|
35 | - '28' => 'Changing password', |
|
36 | - '29' => 'Error', |
|
37 | - '30' => 'Saving settings', |
|
38 | - '31' => 'Using file manager', |
|
39 | - '32' => 'Saving user', |
|
40 | - '33' => 'Deleting user', |
|
41 | - '34' => 'Saving new password', |
|
42 | - '35' => 'Editing role', |
|
43 | - '36' => 'Saving role', |
|
44 | - '37' => 'Deleting role', |
|
45 | - '38' => 'Creating new role', |
|
46 | - '40' => 'Editing Access Permissions', |
|
47 | - '41' => 'Editing Access Permissions', |
|
48 | - '42' => 'Editing Access Permissions', |
|
49 | - '43' => 'Editing Access Permissions', |
|
50 | - '44' => 'Editing Access Permissions', |
|
51 | - '45' => 'Idle', |
|
52 | - '46' => 'Editing Access Permissions', |
|
53 | - '47' => 'Editing Access Permissions', |
|
54 | - '48' => 'Editing Access Permissions', |
|
55 | - '49' => 'Editing Access Permissions', |
|
56 | - '50' => 'Editing Access Permissions', |
|
57 | - '51' => 'Moving resource', |
|
58 | - '52' => 'Moved resource', |
|
59 | - '53' => 'Viewing system info', |
|
60 | - '54' => 'Optimizing a table', |
|
61 | - '55' => 'Empty logs', |
|
62 | - '56' => 'Refresh resource tree', |
|
63 | - '57' => 'Refresh menu', |
|
64 | - '58' => 'Logged in', |
|
65 | - '59' => 'About MODX', |
|
66 | - '60' => 'Emptying Recycle Bin', |
|
67 | - '61' => 'Publishing a resource', |
|
68 | - '62' => 'Un-publishing a resource', |
|
69 | - '63' => 'Un-deleting a resource', |
|
70 | - '64' => 'Removing deleted content', |
|
71 | - '65' => 'Deleting a message', |
|
72 | - '66' => 'Sending a message', |
|
73 | - '67' => 'Removing locks', |
|
74 | - '68' => 'Viewing site logging', |
|
75 | - '69' => 'Viewing online visitors', |
|
76 | - '70' => 'Viewing site schedule', |
|
77 | - '71' => 'Searching', |
|
78 | - '72' => 'Adding a weblink', |
|
79 | - '73' => 'Editing a weblink', |
|
80 | - //case "74" : return "Changing personal preferences"; break; |
|
81 | - '75' => 'User/ role management', |
|
82 | - '76' => 'Element management', |
|
83 | - '77' => 'Creating a new Chunk (HTML Snippet)', |
|
84 | - '78' => 'Editing Chunk (HTML Snippet)', |
|
85 | - '79' => 'Saving Chunk (HTML Snippet)', |
|
86 | - '80' => 'Deleting Chunk (HTML Snippet)', |
|
87 | - '83' => 'Exporting a resource to HTML', |
|
88 | - '84' => 'Load Element Selector', |
|
89 | - '85' => 'Create Folder', |
|
90 | - '86' => 'Role management', |
|
91 | - '87' => 'Create new web user', |
|
92 | - '88' => 'Editing web user', |
|
93 | - '89' => 'Saving web user', |
|
94 | - '90' => 'Deleting web user', |
|
95 | - '91' => 'Editing Web Access Permissions', |
|
96 | - '92' => 'Editing Access Permissions', |
|
97 | - '93' => 'Backup Manager', |
|
98 | - '94' => 'Duplicate resource', |
|
99 | - '95' => 'Importing resources from HTML', |
|
100 | - '96' => 'Duplicate Template', |
|
101 | - '97' => 'Duplicate Chunk (HTML Snippet)', |
|
102 | - '98' => 'Duplicate Snippet', |
|
103 | - '99' => 'Manage Web Users', |
|
104 | - '100' => 'Previewing resource', |
|
105 | - '101' => 'Create new plugin', |
|
106 | - '102' => 'Edit plugin', |
|
107 | - '103' => 'Saving plugin', |
|
108 | - '104' => 'Delete plugin', |
|
109 | - '105' => 'Duplicate plugin', |
|
110 | - '106' => 'Viewing Modules', |
|
111 | - '107' => 'Create new module', |
|
112 | - '108' => 'Edit module', |
|
113 | - '109' => 'Saving module', |
|
114 | - '110' => 'Delete module', |
|
115 | - '111' => 'Duplicate module', |
|
116 | - '112' => 'Execute module', |
|
117 | - '113' => 'Manage module dependencies', |
|
118 | - '114' => 'View event log', |
|
119 | - '115' => 'View event log details', |
|
120 | - '116' => 'Delete event log', |
|
121 | - '117' => 'Editing tv rank', |
|
122 | - '118' => 'Call settings ajax include', |
|
123 | - '119' => 'Login Fail (Temporary Block)', |
|
8 | + '1' => 'Loading a frame(set)', |
|
9 | + '2' => 'Viewing home page/ online users', |
|
10 | + '3' => 'Viewing data for resource', |
|
11 | + '4' => 'Creating a resource', |
|
12 | + '5' => 'Saving resource', |
|
13 | + '6' => 'Deleting resource', |
|
14 | + '7' => 'Waiting while MODX cleans up', |
|
15 | + '8' => 'Logged out', |
|
16 | + '9' => 'Viewing help', |
|
17 | + '10' => 'Viewing/ composing messages', |
|
18 | + '11' => 'Creating a user', |
|
19 | + '12' => 'Editing user', |
|
20 | + '13' => 'Viewing logging', |
|
21 | + '14' => 'Editing a parser', |
|
22 | + '15' => 'Saving a parser', |
|
23 | + '16' => 'Editing template', |
|
24 | + '17' => 'Editing settings', |
|
25 | + '18' => 'Viewing Credits :)', |
|
26 | + '19' => 'Creating a new template', |
|
27 | + '20' => 'Saving template', |
|
28 | + '21' => 'Deleting template', |
|
29 | + '22' => 'Editing Snippet', |
|
30 | + '23' => 'Creating a new Snippet', |
|
31 | + '24' => 'Saving Snippet', |
|
32 | + '25' => 'Deleting Snippet', |
|
33 | + '26' => 'Refreshing site', |
|
34 | + '27' => 'Editing resource', |
|
35 | + '28' => 'Changing password', |
|
36 | + '29' => 'Error', |
|
37 | + '30' => 'Saving settings', |
|
38 | + '31' => 'Using file manager', |
|
39 | + '32' => 'Saving user', |
|
40 | + '33' => 'Deleting user', |
|
41 | + '34' => 'Saving new password', |
|
42 | + '35' => 'Editing role', |
|
43 | + '36' => 'Saving role', |
|
44 | + '37' => 'Deleting role', |
|
45 | + '38' => 'Creating new role', |
|
46 | + '40' => 'Editing Access Permissions', |
|
47 | + '41' => 'Editing Access Permissions', |
|
48 | + '42' => 'Editing Access Permissions', |
|
49 | + '43' => 'Editing Access Permissions', |
|
50 | + '44' => 'Editing Access Permissions', |
|
51 | + '45' => 'Idle', |
|
52 | + '46' => 'Editing Access Permissions', |
|
53 | + '47' => 'Editing Access Permissions', |
|
54 | + '48' => 'Editing Access Permissions', |
|
55 | + '49' => 'Editing Access Permissions', |
|
56 | + '50' => 'Editing Access Permissions', |
|
57 | + '51' => 'Moving resource', |
|
58 | + '52' => 'Moved resource', |
|
59 | + '53' => 'Viewing system info', |
|
60 | + '54' => 'Optimizing a table', |
|
61 | + '55' => 'Empty logs', |
|
62 | + '56' => 'Refresh resource tree', |
|
63 | + '57' => 'Refresh menu', |
|
64 | + '58' => 'Logged in', |
|
65 | + '59' => 'About MODX', |
|
66 | + '60' => 'Emptying Recycle Bin', |
|
67 | + '61' => 'Publishing a resource', |
|
68 | + '62' => 'Un-publishing a resource', |
|
69 | + '63' => 'Un-deleting a resource', |
|
70 | + '64' => 'Removing deleted content', |
|
71 | + '65' => 'Deleting a message', |
|
72 | + '66' => 'Sending a message', |
|
73 | + '67' => 'Removing locks', |
|
74 | + '68' => 'Viewing site logging', |
|
75 | + '69' => 'Viewing online visitors', |
|
76 | + '70' => 'Viewing site schedule', |
|
77 | + '71' => 'Searching', |
|
78 | + '72' => 'Adding a weblink', |
|
79 | + '73' => 'Editing a weblink', |
|
80 | + //case "74" : return "Changing personal preferences"; break; |
|
81 | + '75' => 'User/ role management', |
|
82 | + '76' => 'Element management', |
|
83 | + '77' => 'Creating a new Chunk (HTML Snippet)', |
|
84 | + '78' => 'Editing Chunk (HTML Snippet)', |
|
85 | + '79' => 'Saving Chunk (HTML Snippet)', |
|
86 | + '80' => 'Deleting Chunk (HTML Snippet)', |
|
87 | + '83' => 'Exporting a resource to HTML', |
|
88 | + '84' => 'Load Element Selector', |
|
89 | + '85' => 'Create Folder', |
|
90 | + '86' => 'Role management', |
|
91 | + '87' => 'Create new web user', |
|
92 | + '88' => 'Editing web user', |
|
93 | + '89' => 'Saving web user', |
|
94 | + '90' => 'Deleting web user', |
|
95 | + '91' => 'Editing Web Access Permissions', |
|
96 | + '92' => 'Editing Access Permissions', |
|
97 | + '93' => 'Backup Manager', |
|
98 | + '94' => 'Duplicate resource', |
|
99 | + '95' => 'Importing resources from HTML', |
|
100 | + '96' => 'Duplicate Template', |
|
101 | + '97' => 'Duplicate Chunk (HTML Snippet)', |
|
102 | + '98' => 'Duplicate Snippet', |
|
103 | + '99' => 'Manage Web Users', |
|
104 | + '100' => 'Previewing resource', |
|
105 | + '101' => 'Create new plugin', |
|
106 | + '102' => 'Edit plugin', |
|
107 | + '103' => 'Saving plugin', |
|
108 | + '104' => 'Delete plugin', |
|
109 | + '105' => 'Duplicate plugin', |
|
110 | + '106' => 'Viewing Modules', |
|
111 | + '107' => 'Create new module', |
|
112 | + '108' => 'Edit module', |
|
113 | + '109' => 'Saving module', |
|
114 | + '110' => 'Delete module', |
|
115 | + '111' => 'Duplicate module', |
|
116 | + '112' => 'Execute module', |
|
117 | + '113' => 'Manage module dependencies', |
|
118 | + '114' => 'View event log', |
|
119 | + '115' => 'View event log details', |
|
120 | + '116' => 'Delete event log', |
|
121 | + '117' => 'Editing tv rank', |
|
122 | + '118' => 'Call settings ajax include', |
|
123 | + '119' => 'Login Fail (Temporary Block)', |
|
124 | 124 | |
125 | - '300' => 'Create Template Variable', |
|
126 | - '301' => 'Edit Template Variable', |
|
127 | - '302' => 'Save Template Variable', |
|
128 | - '303' => 'Delete Template Variable', |
|
129 | - '304' => 'Duplicate Template Variable', |
|
125 | + '300' => 'Create Template Variable', |
|
126 | + '301' => 'Edit Template Variable', |
|
127 | + '302' => 'Save Template Variable', |
|
128 | + '303' => 'Delete Template Variable', |
|
129 | + '304' => 'Duplicate Template Variable', |
|
130 | 130 | |
131 | - '200' => 'Viewing phpInfo()', |
|
132 | - '501' => 'Delete category', |
|
133 | - '998' => 'Viewing web page', |
|
134 | - '999' => 'Viewing test page', |
|
131 | + '200' => 'Viewing phpInfo()', |
|
132 | + '501' => 'Delete category', |
|
133 | + '998' => 'Viewing web page', |
|
134 | + '999' => 'Viewing test page', |
|
135 | 135 | ); |
136 | 136 | |
137 | 137 | function getAction($actionId, $itemid='') { |
138 | - global $action_list; |
|
138 | + global $action_list; |
|
139 | 139 | |
140 | - $ret = sprintf($action_list[$actionId], $itemid); |
|
141 | - if (!$ret) $ret = "Idle (unknown)"; |
|
140 | + $ret = sprintf($action_list[$actionId], $itemid); |
|
141 | + if (!$ret) $ret = "Idle (unknown)"; |
|
142 | 142 | |
143 | - return $ret; |
|
143 | + return $ret; |
|
144 | 144 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | if($emptyCache) { |
56 | - $modx->clearCache('full'); |
|
56 | + $modx->clearCache('full'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | echo $str; |
@@ -1,193 +1,193 @@ |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || 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."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
7 | - header('HTTP/1.0 404 Not Found'); |
|
8 | - exit; |
|
7 | + header('HTTP/1.0 404 Not Found'); |
|
8 | + exit; |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | if(isset($_SESSION['mgrValidated']) && $_SESSION['usertype'] != 'manager') { |
12 | - // if (isset($_COOKIE[session_name()])) { |
|
13 | - // setcookie(session_name(), '', 0, MODX_BASE_URL); |
|
14 | - // } |
|
15 | - @session_destroy(); |
|
16 | - // start session |
|
17 | - // startCMSSession(); |
|
12 | + // if (isset($_COOKIE[session_name()])) { |
|
13 | + // setcookie(session_name(), '', 0, MODX_BASE_URL); |
|
14 | + // } |
|
15 | + @session_destroy(); |
|
16 | + // start session |
|
17 | + // startCMSSession(); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | // andrazk 20070416 - if installer is running, destroy active sessions |
21 | 21 | if(file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) { |
22 | - include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php'); |
|
23 | - if(isset($installStartTime)) { |
|
24 | - if((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard |
|
25 | - unset($installStartTime); |
|
26 | - @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755); |
|
27 | - unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php'); |
|
28 | - } else { |
|
29 | - if($_SERVER['REQUEST_METHOD'] != 'POST') { |
|
30 | - if(isset($_COOKIE[session_name()])) { |
|
31 | - session_unset(); |
|
32 | - @session_destroy(); |
|
33 | - // setcookie(session_name(), '', 0, MODX_BASE_URL); |
|
34 | - } |
|
35 | - $installGoingOn = 1; |
|
36 | - } |
|
37 | - } |
|
38 | - } |
|
22 | + include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php'); |
|
23 | + if(isset($installStartTime)) { |
|
24 | + if((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard |
|
25 | + unset($installStartTime); |
|
26 | + @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755); |
|
27 | + unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php'); |
|
28 | + } else { |
|
29 | + if($_SERVER['REQUEST_METHOD'] != 'POST') { |
|
30 | + if(isset($_COOKIE[session_name()])) { |
|
31 | + session_unset(); |
|
32 | + @session_destroy(); |
|
33 | + // setcookie(session_name(), '', 0, MODX_BASE_URL); |
|
34 | + } |
|
35 | + $installGoingOn = 1; |
|
36 | + } |
|
37 | + } |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | // andrazk 20070416 - if session started before install and was not destroyed yet |
42 | 42 | if(isset($lastInstallTime)) { |
43 | - if(isset($_SESSION['mgrValidated'])) { |
|
44 | - if(isset($_SESSION['modx.session.created.time'])) { |
|
45 | - if($_SESSION['modx.session.created.time'] < $lastInstallTime) { |
|
46 | - if($_SERVER['REQUEST_METHOD'] != 'POST') { |
|
47 | - if(isset($_COOKIE[session_name()])) { |
|
48 | - session_unset(); |
|
49 | - @session_destroy(); |
|
50 | - // setcookie(session_name(), '', 0, MODX_BASE_URL); |
|
51 | - } |
|
52 | - header('HTTP/1.0 307 Redirect'); |
|
53 | - header('Location: ' . MODX_MANAGER_URL . 'index.php?installGoingOn=2'); |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | - } |
|
43 | + if(isset($_SESSION['mgrValidated'])) { |
|
44 | + if(isset($_SESSION['modx.session.created.time'])) { |
|
45 | + if($_SESSION['modx.session.created.time'] < $lastInstallTime) { |
|
46 | + if($_SERVER['REQUEST_METHOD'] != 'POST') { |
|
47 | + if(isset($_COOKIE[session_name()])) { |
|
48 | + session_unset(); |
|
49 | + @session_destroy(); |
|
50 | + // setcookie(session_name(), '', 0, MODX_BASE_URL); |
|
51 | + } |
|
52 | + header('HTTP/1.0 307 Redirect'); |
|
53 | + header('Location: ' . MODX_MANAGER_URL . 'index.php?installGoingOn=2'); |
|
54 | + } |
|
55 | + } |
|
56 | + } |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if(!isset($_SESSION['mgrValidated'])) { |
61 | - if(isset($manager_language)) { |
|
62 | - // establish fallback to English default |
|
63 | - include_once "lang/english.inc.php"; |
|
64 | - // include localized overrides |
|
65 | - include_once "lang/" . $manager_language . ".inc.php"; |
|
66 | - } else { |
|
67 | - include_once "lang/english.inc.php"; |
|
68 | - } |
|
69 | - |
|
70 | - $modx->setPlaceholder('modx_charset', $modx_manager_charset); |
|
71 | - $modx->setPlaceholder('theme', $manager_theme); |
|
61 | + if(isset($manager_language)) { |
|
62 | + // establish fallback to English default |
|
63 | + include_once "lang/english.inc.php"; |
|
64 | + // include localized overrides |
|
65 | + include_once "lang/" . $manager_language . ".inc.php"; |
|
66 | + } else { |
|
67 | + include_once "lang/english.inc.php"; |
|
68 | + } |
|
69 | + |
|
70 | + $modx->setPlaceholder('modx_charset', $modx_manager_charset); |
|
71 | + $modx->setPlaceholder('theme', $manager_theme); |
|
72 | 72 | $modx->setPlaceholder('favicon', (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico')); |
73 | 73 | |
74 | - // invoke OnManagerLoginFormPrerender event |
|
75 | - $evtOut = $modx->invokeEvent('OnManagerLoginFormPrerender'); |
|
76 | - $html = is_array($evtOut) ? implode('', $evtOut) : ''; |
|
77 | - $modx->setPlaceholder('OnManagerLoginFormPrerender', $html); |
|
78 | - |
|
79 | - $modx->setPlaceholder('site_name', $site_name); |
|
80 | - $modx->setPlaceholder('manager_path', MGR_DIR); |
|
81 | - $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); |
|
82 | - $modx->setPlaceholder('login_message', $_lang["login_message"]); |
|
83 | - $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); |
|
84 | - $modx->setPlaceholder('year', date('Y')); |
|
85 | - $modx->setPlaceholder('manager_theme_style', (isset($_COOKIE['MODX_themeColor']) ? $_COOKIE['MODX_themeColor'] : '')); |
|
86 | - |
|
87 | - // andrazk 20070416 - notify user of install/update |
|
88 | - if(isset($_GET['installGoingOn'])) { |
|
89 | - $installGoingOn = $_GET['installGoingOn']; |
|
90 | - } |
|
91 | - if(isset($installGoingOn)) { |
|
92 | - switch($installGoingOn) { |
|
93 | - case 1 : |
|
94 | - $modx->setPlaceholder('login_message', "<p><span class=\"fail\">" . $_lang["login_cancelled_install_in_progress"] . "</p><p>" . $_lang["login_message"] . "</p>"); |
|
95 | - break; |
|
96 | - case 2 : |
|
97 | - $modx->setPlaceholder('login_message', "<p><span class=\"fail\">" . $_lang["login_cancelled_site_was_updated"] . "</p><p>" . $_lang["login_message"] . "</p>"); |
|
98 | - break; |
|
99 | - } |
|
100 | - } |
|
101 | - |
|
102 | - if($modx->config['use_captcha'] == 1) { |
|
103 | - $modx->setPlaceholder('login_captcha_message', $_lang["login_captcha_message"]); |
|
104 | - $modx->setPlaceholder('captcha_image', '<a href="' . MODX_MANAGER_URL . '" class="loginCaptcha"><img id="captcha_image" src="' . MODX_MANAGER_URL . 'includes/veriword.php?rand=' . rand() . '" alt="' . $_lang["login_captcha_message"] . '" /></a>'); |
|
105 | - $modx->setPlaceholder('captcha_input', '<label>' . $_lang["captcha_code"] . '</label> <input type="text" name="captcha_code" tabindex="3" value="" />'); |
|
106 | - } |
|
107 | - |
|
108 | - // login info |
|
109 | - $uid = isset($_COOKIE['modx_remember_manager']) ? preg_replace('/[^a-zA-Z0-9\-_@\.]*/', '', $_COOKIE['modx_remember_manager']) : ''; |
|
110 | - $modx->setPlaceholder('uid', $uid); |
|
111 | - $modx->setPlaceholder('username', $_lang["username"]); |
|
112 | - $modx->setPlaceholder('password', $_lang["password"]); |
|
113 | - |
|
114 | - // remember me |
|
115 | - $html = isset($_COOKIE['modx_remember_manager']) ? 'checked="checked"' : ''; |
|
116 | - $modx->setPlaceholder('remember_me', $html); |
|
117 | - $modx->setPlaceholder('remember_username', $_lang["remember_username"]); |
|
118 | - $modx->setPlaceholder('login_button', $_lang["login_button"]); |
|
119 | - |
|
120 | - // invoke OnManagerLoginFormRender event |
|
121 | - $evtOut = $modx->invokeEvent('OnManagerLoginFormRender'); |
|
122 | - $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">' . implode('', $evtOut) . '</div>' : ''; |
|
123 | - $modx->setPlaceholder('OnManagerLoginFormRender', $html); |
|
124 | - |
|
125 | - // load template |
|
126 | - $target = $modx->getConfig('manager_login_tpl'); |
|
127 | - $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
|
128 | - $target = $modx->mergeSettingsContent($target); |
|
129 | - |
|
130 | - $login_tpl = null; |
|
131 | - if(substr($target, 0, 1) === '@') { |
|
132 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
133 | - $target = trim(substr($target, 7)); |
|
134 | - $login_tpl = $modx->getChunk($target); |
|
135 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
136 | - $target = trim(substr($target, 6)); |
|
137 | - $login_tpl = file_get_contents($target); |
|
138 | - } |
|
139 | - } else { |
|
140 | - $theme_path = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/'; |
|
141 | - if(is_file($theme_path . 'style.php')) { |
|
142 | - include($theme_path . 'style.php'); |
|
143 | - } |
|
144 | - $chunk = $modx->getChunk($target); |
|
145 | - if($chunk !== false && !empty($chunk)) { |
|
146 | - $login_tpl = $chunk; |
|
147 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
148 | - $target = MODX_BASE_PATH . $target; |
|
149 | - $login_tpl = file_get_contents($target); |
|
150 | - } elseif(is_file($target)) { |
|
151 | - $login_tpl = file_get_contents($target); |
|
152 | - } elseif(is_file($theme_path . 'login.tpl')) { |
|
153 | - $target = $theme_path . 'login.tpl'; |
|
154 | - $login_tpl = file_get_contents($target); |
|
155 | - } elseif(is_file($theme_path . 'templates/actions/login.tpl')) { |
|
156 | - $target = $theme_path . 'templates/actions/login.tpl'; |
|
157 | - $login_tpl = file_get_contents($target); |
|
158 | - } elseif(is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible |
|
159 | - $target = $theme_path . 'html/login.html'; |
|
160 | - $login_tpl = file_get_contents($target); |
|
161 | - } else { |
|
162 | - $target = MODX_MANAGER_PATH . 'media/style/common/login.tpl'; |
|
163 | - $login_tpl = file_get_contents($target); |
|
164 | - } |
|
165 | - } |
|
166 | - |
|
167 | - // merge placeholders |
|
168 | - $login_tpl = $modx->mergePlaceholderContent($login_tpl); |
|
169 | - $regx = strpos($login_tpl, '[[+') !== false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
170 | - $login_tpl = preg_replace($regx, '', $login_tpl); //cleanup |
|
171 | - |
|
172 | - echo $login_tpl; |
|
173 | - |
|
174 | - exit; |
|
74 | + // invoke OnManagerLoginFormPrerender event |
|
75 | + $evtOut = $modx->invokeEvent('OnManagerLoginFormPrerender'); |
|
76 | + $html = is_array($evtOut) ? implode('', $evtOut) : ''; |
|
77 | + $modx->setPlaceholder('OnManagerLoginFormPrerender', $html); |
|
78 | + |
|
79 | + $modx->setPlaceholder('site_name', $site_name); |
|
80 | + $modx->setPlaceholder('manager_path', MGR_DIR); |
|
81 | + $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); |
|
82 | + $modx->setPlaceholder('login_message', $_lang["login_message"]); |
|
83 | + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); |
|
84 | + $modx->setPlaceholder('year', date('Y')); |
|
85 | + $modx->setPlaceholder('manager_theme_style', (isset($_COOKIE['MODX_themeColor']) ? $_COOKIE['MODX_themeColor'] : '')); |
|
86 | + |
|
87 | + // andrazk 20070416 - notify user of install/update |
|
88 | + if(isset($_GET['installGoingOn'])) { |
|
89 | + $installGoingOn = $_GET['installGoingOn']; |
|
90 | + } |
|
91 | + if(isset($installGoingOn)) { |
|
92 | + switch($installGoingOn) { |
|
93 | + case 1 : |
|
94 | + $modx->setPlaceholder('login_message', "<p><span class=\"fail\">" . $_lang["login_cancelled_install_in_progress"] . "</p><p>" . $_lang["login_message"] . "</p>"); |
|
95 | + break; |
|
96 | + case 2 : |
|
97 | + $modx->setPlaceholder('login_message', "<p><span class=\"fail\">" . $_lang["login_cancelled_site_was_updated"] . "</p><p>" . $_lang["login_message"] . "</p>"); |
|
98 | + break; |
|
99 | + } |
|
100 | + } |
|
101 | + |
|
102 | + if($modx->config['use_captcha'] == 1) { |
|
103 | + $modx->setPlaceholder('login_captcha_message', $_lang["login_captcha_message"]); |
|
104 | + $modx->setPlaceholder('captcha_image', '<a href="' . MODX_MANAGER_URL . '" class="loginCaptcha"><img id="captcha_image" src="' . MODX_MANAGER_URL . 'includes/veriword.php?rand=' . rand() . '" alt="' . $_lang["login_captcha_message"] . '" /></a>'); |
|
105 | + $modx->setPlaceholder('captcha_input', '<label>' . $_lang["captcha_code"] . '</label> <input type="text" name="captcha_code" tabindex="3" value="" />'); |
|
106 | + } |
|
107 | + |
|
108 | + // login info |
|
109 | + $uid = isset($_COOKIE['modx_remember_manager']) ? preg_replace('/[^a-zA-Z0-9\-_@\.]*/', '', $_COOKIE['modx_remember_manager']) : ''; |
|
110 | + $modx->setPlaceholder('uid', $uid); |
|
111 | + $modx->setPlaceholder('username', $_lang["username"]); |
|
112 | + $modx->setPlaceholder('password', $_lang["password"]); |
|
113 | + |
|
114 | + // remember me |
|
115 | + $html = isset($_COOKIE['modx_remember_manager']) ? 'checked="checked"' : ''; |
|
116 | + $modx->setPlaceholder('remember_me', $html); |
|
117 | + $modx->setPlaceholder('remember_username', $_lang["remember_username"]); |
|
118 | + $modx->setPlaceholder('login_button', $_lang["login_button"]); |
|
119 | + |
|
120 | + // invoke OnManagerLoginFormRender event |
|
121 | + $evtOut = $modx->invokeEvent('OnManagerLoginFormRender'); |
|
122 | + $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">' . implode('', $evtOut) . '</div>' : ''; |
|
123 | + $modx->setPlaceholder('OnManagerLoginFormRender', $html); |
|
124 | + |
|
125 | + // load template |
|
126 | + $target = $modx->getConfig('manager_login_tpl'); |
|
127 | + $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
|
128 | + $target = $modx->mergeSettingsContent($target); |
|
129 | + |
|
130 | + $login_tpl = null; |
|
131 | + if(substr($target, 0, 1) === '@') { |
|
132 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
133 | + $target = trim(substr($target, 7)); |
|
134 | + $login_tpl = $modx->getChunk($target); |
|
135 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
136 | + $target = trim(substr($target, 6)); |
|
137 | + $login_tpl = file_get_contents($target); |
|
138 | + } |
|
139 | + } else { |
|
140 | + $theme_path = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/'; |
|
141 | + if(is_file($theme_path . 'style.php')) { |
|
142 | + include($theme_path . 'style.php'); |
|
143 | + } |
|
144 | + $chunk = $modx->getChunk($target); |
|
145 | + if($chunk !== false && !empty($chunk)) { |
|
146 | + $login_tpl = $chunk; |
|
147 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
148 | + $target = MODX_BASE_PATH . $target; |
|
149 | + $login_tpl = file_get_contents($target); |
|
150 | + } elseif(is_file($target)) { |
|
151 | + $login_tpl = file_get_contents($target); |
|
152 | + } elseif(is_file($theme_path . 'login.tpl')) { |
|
153 | + $target = $theme_path . 'login.tpl'; |
|
154 | + $login_tpl = file_get_contents($target); |
|
155 | + } elseif(is_file($theme_path . 'templates/actions/login.tpl')) { |
|
156 | + $target = $theme_path . 'templates/actions/login.tpl'; |
|
157 | + $login_tpl = file_get_contents($target); |
|
158 | + } elseif(is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible |
|
159 | + $target = $theme_path . 'html/login.html'; |
|
160 | + $login_tpl = file_get_contents($target); |
|
161 | + } else { |
|
162 | + $target = MODX_MANAGER_PATH . 'media/style/common/login.tpl'; |
|
163 | + $login_tpl = file_get_contents($target); |
|
164 | + } |
|
165 | + } |
|
166 | + |
|
167 | + // merge placeholders |
|
168 | + $login_tpl = $modx->mergePlaceholderContent($login_tpl); |
|
169 | + $regx = strpos($login_tpl, '[[+') !== false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
170 | + $login_tpl = preg_replace($regx, '', $login_tpl); //cleanup |
|
171 | + |
|
172 | + echo $login_tpl; |
|
173 | + |
|
174 | + exit; |
|
175 | 175 | |
176 | 176 | } else { |
177 | - // Update table active_user_sessions |
|
178 | - $modx->updateValidatedUserSession(); |
|
179 | - |
|
180 | - // Update last action in table active_users |
|
181 | - $itemid = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : ''; |
|
182 | - $lasthittime = time(); |
|
183 | - $action = isset($_REQUEST['a']) ? (int) $_REQUEST['a'] : 1; |
|
184 | - |
|
185 | - if($action !== 1) { |
|
186 | - if(!intval($itemid)) { |
|
187 | - $itemid = null; |
|
188 | - } |
|
189 | - $sql = sprintf("REPLACE INTO %s (sid, internalKey, username, lasthit, action, id) VALUES ('%s', %d, '%s', %d, '%s', %s)", $modx->getFullTableName('active_users') // Table |
|
190 | - , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string) $action, $itemid == null ? var_export(null, true) : $itemid); |
|
191 | - $modx->db->query($sql); |
|
192 | - } |
|
177 | + // Update table active_user_sessions |
|
178 | + $modx->updateValidatedUserSession(); |
|
179 | + |
|
180 | + // Update last action in table active_users |
|
181 | + $itemid = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : ''; |
|
182 | + $lasthittime = time(); |
|
183 | + $action = isset($_REQUEST['a']) ? (int) $_REQUEST['a'] : 1; |
|
184 | + |
|
185 | + if($action !== 1) { |
|
186 | + if(!intval($itemid)) { |
|
187 | + $itemid = null; |
|
188 | + } |
|
189 | + $sql = sprintf("REPLACE INTO %s (sid, internalKey, username, lasthit, action, id) VALUES ('%s', %d, '%s', %d, '%s', %s)", $modx->getFullTableName('active_users') // Table |
|
190 | + , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string) $action, $itemid == null ? var_export(null, true) : $itemid); |
|
191 | + $modx->db->query($sql); |
|
192 | + } |
|
193 | 193 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || 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."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | global $SystemAlertMsgQueque; |
6 | 6 | // display system alert window if messages are available |
7 | 7 | if(count($SystemAlertMsgQueque) > 0) { |
8 | - include "sysalert.display.inc.php"; |
|
8 | + include "sysalert.display.inc.php"; |
|
9 | 9 | } |
10 | 10 | ?> |
11 | 11 | <script type='text/javascript'> |
@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | </script> |
20 | 20 | <?php |
21 | 21 | if(in_array($modx->manager->action, array( |
22 | - 85, |
|
23 | - 27, |
|
24 | - 4, |
|
25 | - 72, |
|
26 | - 13, |
|
27 | - 11, |
|
28 | - 12, |
|
29 | - 87, |
|
30 | - 88 |
|
22 | + 85, |
|
23 | + 27, |
|
24 | + 4, |
|
25 | + 72, |
|
26 | + 13, |
|
27 | + 11, |
|
28 | + 12, |
|
29 | + 87, |
|
30 | + 88 |
|
31 | 31 | ))) { |
32 | - echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); |
|
32 | + echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | </body> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('export_static')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $maxtime = (is_numeric($_POST['maxtime'])) ? $_POST['maxtime'] : 30; |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | $modx->export->targetDir = $export_dir; |
18 | 18 | |
19 | 19 | if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
20 | - return $_lang['export_site.static.php6']; |
|
20 | + return $_lang['export_site.static.php6']; |
|
21 | 21 | elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
22 | - return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
22 | + return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
23 | 23 | elseif(!is_writable($export_dir)) |
24 | - return $_lang['export_site_target_unwritable']; |
|
24 | + return $_lang['export_site_target_unwritable']; |
|
25 | 25 | |
26 | 26 | $modx->export->generate_mode = $_POST['generate_mode']; |
27 | 27 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ||$includenoncache!==$_POST['includenoncache'] |
38 | 38 | ||$repl_before!==$_POST['repl_before'] |
39 | 39 | ||$repl_after !==$_POST['repl_after']) { |
40 | - $modx->clearCache('full'); |
|
40 | + $modx->clearCache('full'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $total = $modx->export->getTotal($_POST['ignore_ids'], $modx->config['export_includenoncache']); |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('delete_module')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? intval($_GET['id']) : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // Set the item name for logger |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeModFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeModFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the module. |
25 | 25 | $modx->db->delete($modx->getFullTableName('site_modules'), "id='{$id}'"); |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | |
33 | 33 | // invoke OnModFormDelete event |
34 | 34 | $modx->invokeEvent("OnModFormDelete", |
35 | - array( |
|
36 | - "id" => $id |
|
37 | - )); |
|
35 | + array( |
|
36 | + "id" => $id |
|
37 | + )); |
|
38 | 38 | |
39 | 39 | // empty cache |
40 | 40 | $modx->clearCache('full'); |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? intval($_GET['id']) : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | $children = array(); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $udperms->duplicateDoc = true; |
23 | 23 | |
24 | 24 | if(!$udperms->checkPermissions()) { |
25 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
25 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | // Run the duplicator |
@@ -37,125 +37,125 @@ discard block |
||
37 | 37 | header($header); |
38 | 38 | |
39 | 39 | function duplicateDocument($docid, $parent=null, $_toplevel=0) { |
40 | - global $modx, $_lang; |
|
41 | - |
|
42 | - // invoke OnBeforeDocDuplicate event |
|
43 | - $evtOut = $modx->invokeEvent('OnBeforeDocDuplicate', array( |
|
44 | - 'id' => $docid |
|
45 | - )); |
|
46 | - |
|
47 | - // if( !in_array( 'false', array_values( $evtOut ) ) ){} |
|
48 | - // TODO: Determine necessary handling for duplicateDocument "return $newparent" if OnBeforeDocDuplicate were able to conditially control duplication |
|
49 | - // [DISABLED]: Proceed with duplicateDocument if OnBeforeDocDuplicate did not return false via: $event->output('false'); |
|
50 | - |
|
51 | - $userID = $modx->getLoginUserID(); |
|
52 | - |
|
53 | - $tblsc = $modx->getFullTableName('site_content'); |
|
54 | - |
|
55 | - // Grab the original document |
|
56 | - $rs = $modx->db->select('*', $tblsc, "id='{$docid}'"); |
|
57 | - $content = $modx->db->getRow($rs); |
|
58 | - |
|
59 | - // Handle incremental ID |
|
60 | - switch($modx->config['docid_incrmnt_method']) |
|
61 | - { |
|
62 | - case '1': |
|
63 | - $from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id"; |
|
64 | - $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
65 | - $content['id'] = $modx->db->getValue($rs); |
|
66 | - break; |
|
67 | - case '2': |
|
68 | - $rs = $modx->db->select('MAX(id)+1',$tblsc); |
|
69 | - $content['id'] = $modx->db->getValue($rs); |
|
70 | - break; |
|
71 | - |
|
72 | - default: |
|
73 | - unset($content['id']); // remove the current id. |
|
74 | - } |
|
75 | - |
|
76 | - // Once we've grabbed the document object, start doing some modifications |
|
77 | - if ($_toplevel == 0) { |
|
78 | - // count duplicates |
|
79 | - $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'")); |
|
80 | - $pagetitle = $modx->db->escape($pagetitle); |
|
81 | - $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'")); |
|
82 | - if($count>=1) $count = ' '.($count+1); |
|
83 | - else $count = ''; |
|
84 | - |
|
85 | - $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle']; |
|
86 | - $content['alias'] = null; |
|
87 | - } elseif($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) { |
|
88 | - $content['alias'] = null; |
|
89 | - } |
|
90 | - |
|
91 | - // change the parent accordingly |
|
92 | - if ($parent !== null) $content['parent'] = $parent; |
|
93 | - |
|
94 | - // Change the author |
|
95 | - $content['createdby'] = $userID; |
|
96 | - $content['createdon'] = time(); |
|
97 | - // Remove other modification times |
|
98 | - $content['editedby'] = $content['editedon'] = $content['deleted'] = $content['deletedby'] = $content['deletedon'] = 0; |
|
99 | - |
|
100 | - // [FS#922] Should the published status be honored? - sirlancelot |
|
40 | + global $modx, $_lang; |
|
41 | + |
|
42 | + // invoke OnBeforeDocDuplicate event |
|
43 | + $evtOut = $modx->invokeEvent('OnBeforeDocDuplicate', array( |
|
44 | + 'id' => $docid |
|
45 | + )); |
|
46 | + |
|
47 | + // if( !in_array( 'false', array_values( $evtOut ) ) ){} |
|
48 | + // TODO: Determine necessary handling for duplicateDocument "return $newparent" if OnBeforeDocDuplicate were able to conditially control duplication |
|
49 | + // [DISABLED]: Proceed with duplicateDocument if OnBeforeDocDuplicate did not return false via: $event->output('false'); |
|
50 | + |
|
51 | + $userID = $modx->getLoginUserID(); |
|
52 | + |
|
53 | + $tblsc = $modx->getFullTableName('site_content'); |
|
54 | + |
|
55 | + // Grab the original document |
|
56 | + $rs = $modx->db->select('*', $tblsc, "id='{$docid}'"); |
|
57 | + $content = $modx->db->getRow($rs); |
|
58 | + |
|
59 | + // Handle incremental ID |
|
60 | + switch($modx->config['docid_incrmnt_method']) |
|
61 | + { |
|
62 | + case '1': |
|
63 | + $from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id"; |
|
64 | + $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
65 | + $content['id'] = $modx->db->getValue($rs); |
|
66 | + break; |
|
67 | + case '2': |
|
68 | + $rs = $modx->db->select('MAX(id)+1',$tblsc); |
|
69 | + $content['id'] = $modx->db->getValue($rs); |
|
70 | + break; |
|
71 | + |
|
72 | + default: |
|
73 | + unset($content['id']); // remove the current id. |
|
74 | + } |
|
75 | + |
|
76 | + // Once we've grabbed the document object, start doing some modifications |
|
77 | + if ($_toplevel == 0) { |
|
78 | + // count duplicates |
|
79 | + $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'")); |
|
80 | + $pagetitle = $modx->db->escape($pagetitle); |
|
81 | + $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'")); |
|
82 | + if($count>=1) $count = ' '.($count+1); |
|
83 | + else $count = ''; |
|
84 | + |
|
85 | + $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle']; |
|
86 | + $content['alias'] = null; |
|
87 | + } elseif($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) { |
|
88 | + $content['alias'] = null; |
|
89 | + } |
|
90 | + |
|
91 | + // change the parent accordingly |
|
92 | + if ($parent !== null) $content['parent'] = $parent; |
|
93 | + |
|
94 | + // Change the author |
|
95 | + $content['createdby'] = $userID; |
|
96 | + $content['createdon'] = time(); |
|
97 | + // Remove other modification times |
|
98 | + $content['editedby'] = $content['editedon'] = $content['deleted'] = $content['deletedby'] = $content['deletedon'] = 0; |
|
99 | + |
|
100 | + // [FS#922] Should the published status be honored? - sirlancelot |
|
101 | 101 | // if ($modx->hasPermission('publish_document')) { |
102 | 102 | // if ($modx->config['publish_default']) |
103 | 103 | // $content['pub_date'] = $content['pub_date']; // should this be changed to 1? |
104 | 104 | // else $content['pub_date'] = 0; |
105 | 105 | // } else { |
106 | - // User can't publish documents |
|
106 | + // User can't publish documents |
|
107 | 107 | // $content['published'] = $content['pub_date'] = 0; |
108 | 108 | // } |
109 | 109 | |
110 | 110 | // Set the published status to unpublished by default (see above ... commit #3388) |
111 | 111 | $content['published'] = $content['pub_date'] = 0; |
112 | 112 | |
113 | - // Escape the proper strings |
|
114 | - $content = $modx->db->escape($content); |
|
113 | + // Escape the proper strings |
|
114 | + $content = $modx->db->escape($content); |
|
115 | 115 | |
116 | - // Duplicate the Document |
|
117 | - $newparent = $modx->db->insert($content, $tblsc); |
|
116 | + // Duplicate the Document |
|
117 | + $newparent = $modx->db->insert($content, $tblsc); |
|
118 | 118 | |
119 | - // duplicate document's TVs |
|
120 | - duplicateTVs($docid, $newparent); |
|
121 | - duplicateAccess($docid, $newparent); |
|
119 | + // duplicate document's TVs |
|
120 | + duplicateTVs($docid, $newparent); |
|
121 | + duplicateAccess($docid, $newparent); |
|
122 | 122 | |
123 | - // invoke OnDocDuplicate event |
|
124 | - $evtOut = $modx->invokeEvent('OnDocDuplicate', array( |
|
125 | - 'id' => $docid, |
|
126 | - 'new_id' => $newparent |
|
127 | - )); |
|
123 | + // invoke OnDocDuplicate event |
|
124 | + $evtOut = $modx->invokeEvent('OnDocDuplicate', array( |
|
125 | + 'id' => $docid, |
|
126 | + 'new_id' => $newparent |
|
127 | + )); |
|
128 | 128 | |
129 | - // Start duplicating all the child documents that aren't deleted. |
|
130 | - $_toplevel++; |
|
131 | - $rs = $modx->db->select('id', $tblsc, "parent='{$docid}' AND deleted=0", 'id ASC'); |
|
132 | - while ($row = $modx->db->getRow($rs)) |
|
133 | - duplicateDocument($row['id'], $newparent, $_toplevel); |
|
129 | + // Start duplicating all the child documents that aren't deleted. |
|
130 | + $_toplevel++; |
|
131 | + $rs = $modx->db->select('id', $tblsc, "parent='{$docid}' AND deleted=0", 'id ASC'); |
|
132 | + while ($row = $modx->db->getRow($rs)) |
|
133 | + duplicateDocument($row['id'], $newparent, $_toplevel); |
|
134 | 134 | |
135 | - // return the new doc id |
|
136 | - return $newparent; |
|
135 | + // return the new doc id |
|
136 | + return $newparent; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | // Duplicate Document TVs |
140 | 140 | function duplicateTVs($oldid,$newid){ |
141 | - global $modx; |
|
141 | + global $modx; |
|
142 | 142 | |
143 | - $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues'); |
|
143 | + $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues'); |
|
144 | 144 | |
145 | - $modx->db->insert( |
|
146 | - array('contentid'=>'', 'tmplvarid'=>'', 'value'=>''), $tbltvc, // Insert into |
|
147 | - "{$newid}, tmplvarid, value", $tbltvc, "contentid='{$oldid}'" // Copy from |
|
148 | - ); |
|
145 | + $modx->db->insert( |
|
146 | + array('contentid'=>'', 'tmplvarid'=>'', 'value'=>''), $tbltvc, // Insert into |
|
147 | + "{$newid}, tmplvarid, value", $tbltvc, "contentid='{$oldid}'" // Copy from |
|
148 | + ); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | // Duplicate Document Access Permissions |
152 | 152 | function duplicateAccess($oldid,$newid){ |
153 | - global $modx; |
|
153 | + global $modx; |
|
154 | 154 | |
155 | - $tbldg = $modx->getFullTableName('document_groups'); |
|
155 | + $tbldg = $modx->getFullTableName('document_groups'); |
|
156 | 156 | |
157 | - $modx->db->insert( |
|
158 | - array('document'=>'', 'document_group'=>''), $tbldg, // Insert into |
|
159 | - "{$newid}, document_group", $tbldg, "document='{$oldid}'" // Copy from |
|
160 | - ); |
|
157 | + $modx->db->insert( |
|
158 | + array('document'=>'', 'document_group'=>''), $tbldg, // Insert into |
|
159 | + "{$newid}, document_group", $tbldg, "document='{$oldid}'" // Copy from |
|
160 | + ); |
|
161 | 161 | } |
@@ -3,17 +3,17 @@ |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('delete_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | if (isset($_GET['cls']) && $_GET['cls']==1) { |
10 | - $where = ''; |
|
10 | + $where = ''; |
|
11 | 11 | } else { |
12 | - $id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
13 | - if($id==0) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
15 | - } |
|
16 | - $where = "id='{$id}'"; |
|
12 | + $id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
13 | + if($id==0) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
15 | + } |
|
16 | + $where = "id='{$id}'"; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | // delete event log |