Merge lp:~vierbergenlars/remotecp-panel/two-panels into lp:remotecp-panel/2.x

Proposed by Lars Vierbergen
Status: Merged
Approved by: Lars Vierbergen
Approved revision: 113
Merged at revision: 111
Proposed branch: lp:~vierbergenlars/remotecp-panel/two-panels
Merge into: lp:remotecp-panel/2.x
Diff against target: 1724 lines
To merge this branch: bzr merge lp:~vierbergenlars/remotecp-panel/two-panels
Reviewer Review Type Date Requested Status
Lars Vierbergen Approve
Review via email: mp+55584@code.launchpad.net

Description of the change

Splits the panel in two pieces, one for local actions, one for remote databases
Implements blueprint https://blueprints.launchpad.net/remotecp-panel/+spec/two-panels

To post a comment you must log in.
Revision history for this message
Lars Vierbergen (vierbergenlars) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'frame.php'
2--- frame.php 2011-03-25 19:28:58 +0000
3+++ frame.php 2011-03-30 16:10:37 +0000
4@@ -1,4 +1,4 @@
5-<?php
6+<?php //@./frame.php ?><?php
7 require('inc/controllers.php');
8 ?>
9 <!DOCTYPE>
10
11=== modified file 'inc/accountlevels.php'
12--- inc/accountlevels.php 2011-01-30 17:23:45 +0000
13+++ inc/accountlevels.php 2011-03-30 16:10:37 +0000
14@@ -14,9 +14,9 @@
15 }
16 $site=addslashes($site);
17 define('SITE',$site);
18+unset($site);
19
20 function getLevel($user,$ref) {
21- if(!RDB) return 0;
22 global $remote_connection;
23 $sql="SELECT `userlevel` FROM `sites` WHERE `username`='".$user."' AND `ref`='".$ref."'";
24 $res=$remote_connection->query($sql);
25@@ -25,8 +25,8 @@
26 return $userlevel;
27 }
28
29-if($site!='') {
30- $userlevel=getLevel($session->username,$site);
31+if(SITE!='') {
32+ $userlevel=getLevel($session->username,SITE);
33 }
34 else {
35 $userlevel=null;
36@@ -46,9 +46,8 @@
37 else {return false;}
38 }
39 function hasSiteAddonLevel() {
40- if(!RDB) return false;
41- global $userlevel,$remote_connection,$site,$local_connection;
42- $q=$remote_connection->query('SELECT * FROM `'.$site.'_addons` WHERE `reference`="'.$local_connection->real_escape_string($_GET['aref']).'"');
43+ global $userlevel,$remote_connection,$local_connection;
44+ $q=$remote_connection->query('SELECT * FROM `'.SITE.'_addons` WHERE `reference`="'.$local_connection->real_escape_string($_GET['aref']).'"');
45 $data=$q->fetch_assoc();
46 if($userlevel>=$data['ulevel']) {
47 return true;
48
49=== modified file 'inc/controllers.php'
50--- inc/controllers.php 2011-03-11 18:12:09 +0000
51+++ inc/controllers.php 2011-03-30 16:10:37 +0000
52@@ -1,4 +1,4 @@
53-<?php
54+<?php //@./inc/controllers.php ?><?php
55 if (get_magic_quotes_gpc()) { //Disable & remove magic quotes ! (http://www.php.net/manual/en/security.magicquotes.disabling.php: example 2)
56 $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
57 while (list($key, $val) = each($process)) {
58@@ -30,5 +30,3 @@
59 // End sqlsess
60 require_once('inc/sitemgmt/session.php');
61 require_once('trans/trans.php');
62-require_once('inc/remotedbauth.php');
63-require_once('inc/accountlevels.php');
64\ No newline at end of file
65
66=== modified file 'inc/languageCodes.php'
67--- inc/languageCodes.php 2011-03-14 20:13:50 +0000
68+++ inc/languageCodes.php 2011-03-30 16:10:37 +0000
69@@ -1,4 +1,4 @@
70-<?php
71+<?php //@./inc/languageCodes.php ?><?php
72 $languageCodes = array(
73 "aa" => "Afar",
74 "ab" => "Abkhazian",
75
76=== added directory 'inc/rdb'
77=== added file 'inc/rdb/auth.php'
78--- inc/rdb/auth.php 1970-01-01 00:00:00 +0000
79+++ inc/rdb/auth.php 2011-03-30 16:10:37 +0000
80@@ -0,0 +1,45 @@
81+<?php //@./inc/rdb/auth.php ?><?php
82+/**
83+ * Class for remote database authentication
84+ */
85+class rdb_auth {
86+ private $dbid=0; //The database id number
87+ public $logged_in=false;
88+ public $level=0;
89+ public $exists=false;
90+ function __construct() {
91+ global $local_connection;
92+ $this->dbid=substr($_SERVER['PATH_INFO'],1,32);
93+ $dblookup=$local_connection->query('SELECT * FROM `remote_databases` WHERE `key`=\''.substr($_SERVER['PATH_INFO'],1,32).'\'');
94+ if($dblookup->num_rows==1)
95+ $this->exists=true;
96+ else
97+ return;
98+ if(($chkauth=$this->checkauth())!==false) {
99+ $this->logged_in=true;
100+ $this->level=$chkauth;
101+ }
102+ }
103+ private function checkauth() {
104+ global $local_connection,$session;
105+ $dbaccess=$local_connection->query('SELECT * FROM `remote_databases_assignments` WHERE `key`=\''.$this->dbid.'\' AND `username`=\''.$session->username.'\'');
106+ if($dbaccess->num_rows==1) {
107+ return $dbaccess->fetch_object()->level;
108+ }
109+ }
110+ function connect() {
111+ if($this->checkauth()===false||$this->exists===false) return NULL;
112+ global $local_connection;
113+ $dblookup=$local_connection->query('SELECT * FROM `remote_databases` WHERE `key`=\''.$this->dbid.'\'');
114+ $rdbauth=$dblookup->fetch_assoc();
115+ if($rdbauth['accesstype']==1) {
116+ require_once('inc/httpmysql/httpmysql.php');
117+ $remote_connection=new HTTPMySQL("http://$rdbauth[user]:$rdbauth[password]@$rdbauth[host]/$rdbauth[database]/query.php"); //HTTPMySQL remote connection
118+ }
119+ else {
120+ $remote_connection=new MySQLi($rdbauth['host'],$rdbauth['user'],$rdbauth['password'],$rdbauth['database']);
121+ }
122+ return $remote_connection;
123+ }
124+}
125+$rdb_auth=new rdb_auth;
126\ No newline at end of file
127
128=== renamed file 'inc/remotedbauth.php' => 'inc/rdb/rdb.php'
129--- inc/remotedbauth.php 2011-01-30 17:23:45 +0000
130+++ inc/rdb/rdb.php 2011-03-30 16:10:37 +0000
131@@ -1,31 +1,39 @@
132-<?php //@./inc/remotedbauth.php ?>
133+<?php //@./inc/rdb/rdb.php ?>
134 <?php
135 /**
136 * Lookup and authentication of the remote database
137 */
138-if(isset($_SERVER['PATH_INFO'])) {
139- $dblookup=$local_connection->query('SELECT * FROM `remote_databases` WHERE `key`=\''.substr($_SERVER['PATH_INFO'],1,32).'\'');
140- if($dblookup->num_rows!=1) trigger_error('RemoteCP: Remote database key not found',E_USER_ERROR); //Database unknown
141- $dbaccess=$local_connection->query('SELECT * FROM `remote_databases_assignments` WHERE `key`=\''.substr($_SERVER['PATH_INFO'],1,32).'\' AND `username`=\''.$session->username.'\'');
142- if($dbaccess->num_rows!=1) {
143- trigger_error('RemoteCP: Remote database access not allowed',E_USER_ERROR);
144- }
145- $rdbaccess=$dbaccess->fetch_assoc();
146- define("RDB_AUTH",$rdbaccess['level']);
147- $rdbauth=$dblookup->fetch_assoc();
148- if($rdbauth['accesstype']) {
149- require_once('inc/httpmysql/httpmysql.php');
150- $remote_connection=new HTTPMySQL("http://$rdbauth[user]:$rdbauth[password]@$rdbauth[host]/$rdbauth[database]/query.php"); //HTTPMySQL remote connection
151- }
152- else {
153- $remote_connection=new MySQLi($rdbauth['host'],$rdbauth['user'],$rdbauth['password'],$rdbauth['database']);
154- }
155- define("RDB",true);
156+require_once('inc/rdb/auth.php');
157+if(!$rdb_auth->exists) {
158+ die('Remote database does not exist');
159 }
160 else {
161- $remote_connection=NULL;
162- define("RDB",false);
163+ $remote_connection=$rdb_auth->connect();
164 }
165
166-if(RDB) require_once('inc/remote_session/session.php'); //Load the remote session handler
167+// if(isset($_SERVER['PATH_INFO'])) {
168+ // $dblookup=$local_connection->query('SELECT * FROM `remote_databases` WHERE `key`=\''.substr($_SERVER['PATH_INFO'],1,32).'\'');
169+ // if($dblookup->num_rows!=1) trigger_error('RemoteCP: Remote database key not found',E_USER_ERROR); //Database unknown
170+ // $dbaccess=$local_connection->query('SELECT * FROM `remote_databases_assignments` WHERE `key`=\''.substr($_SERVER['PATH_INFO'],1,32).'\' AND `username`=\''.$session->username.'\'');
171+ // if($dbaccess->num_rows!=1) {
172+ // trigger_error('RemoteCP: Remote database access not allowed',E_USER_ERROR);
173+ // }
174+ // $rdbaccess=$dbaccess->fetch_assoc();
175+ // define("RDB_AUTH",$rdbaccess['level']);
176+ // $rdbauth=$dblookup->fetch_assoc();
177+ // if($rdbauth['accesstype']) {
178+ // require_once('inc/httpmysql/httpmysql.php');
179+ // $remote_connection=new HTTPMySQL("http://$rdbauth[user]:$rdbauth[password]@$rdbauth[host]/$rdbauth[database]/query.php"); //HTTPMySQL remote connection
180+ // }
181+ // else {
182+ // $remote_connection=new MySQLi($rdbauth['host'],$rdbauth['user'],$rdbauth['password'],$rdbauth['database']);
183+ // }
184+ // define("RDB",true);
185+// }
186+// else {
187+ // $remote_connection=NULL;
188+ // define("RDB",false);
189+// }
190+
191+// if(RDB) require_once('inc/rdb/session.php'); //Load the remote session handler
192 ?>
193\ No newline at end of file
194
195=== renamed file 'inc/remote_session/session.php' => 'inc/rdb/session.php'
196--- inc/remote_session/session.php 2011-01-31 16:01:17 +0000
197+++ inc/rdb/session.php 2011-03-30 16:10:37 +0000
198@@ -1,36 +1,33 @@
199-<?php //@./inc/remote_session/session.php ?>
200+<?php //@./inc/rdb/session.php ?>
201 <?php
202-class remote_session {
203- private $database;
204- public $userlevel;
205- public $dbkey=NULL; //Set the database key
206- private $username;
207- private $authenticated;
208-
209- function __construct() {
210- global $local_connection,$session;
211- $this->dbkey=substr($_SERVER['PATH_INFO'],1,32);
212- $this->database=$local_connection;
213- $this->username=$session->username;
214- if($this->init()) $this->authenticated=true;
215- else $this->authenticated=false;
216- }
217- private function init() {
218- $q0=$this->database->query('SELECT * FROM `remote_databases_assignments` WHERE `key`=\''.$this->dbkey.'\' AND `username`=\''.$this->username.'\'');
219- if($q0->num_rows!=1) return false;
220- $r0=$q0->fetch_assoc();
221- $this->userlevel=$r0['level'];
222- return true;
223- }
224- function isAdmin() {
225- return ($this->userlevel==9);
226- }
227- function isSiteCreator() {
228- return ($this->userlevel>=2);
229- }
230- function authenticated() {
231- return $this->authenticated;
232- }
233-}
234-
235-$remote_session=new remote_session;
236\ No newline at end of file
237+// class remote_session {
238+ // public bool $logged_in=false;
239+ // public int $userlevel=0;
240+
241+ // function __construct() {
242+ // global $rdbauth,$session;
243+ // $this->dbkey=substr($_SERVER['PATH_INFO'],1,32);
244+ // $this->database=$local_connection;
245+ // $this->username=$session->username;
246+ // if($this->init()) $this->authenticated=true;
247+ // else $this->authenticated=false;
248+ // }
249+ // private function init() {
250+ // $q0=$this->database->query('SELECT * FROM `remote_databases_assignments` WHERE `key`=\''.$this->dbkey.'\' AND `username`=\''.$this->username.'\'');
251+ // if($q0->num_rows!=1) return false;
252+ // $r0=$q0->fetch_assoc();
253+ // $this->userlevel=$r0['level'];
254+ // return true;
255+ // }
256+ // function isAdmin() {
257+ // return ($this->userlevel==9);
258+ // }
259+ // function isSiteCreator() {
260+ // return ($this->userlevel>=2);
261+ // }
262+ // function authenticated() {
263+ // return $this->authenticated;
264+ // }
265+// }
266+
267+// $remote_session=new remote_session;
268\ No newline at end of file
269
270=== removed directory 'inc/remote_session'
271=== modified file 'panel.php'
272--- panel.php 2011-03-14 17:11:00 +0000
273+++ panel.php 2011-03-30 16:10:37 +0000
274@@ -180,59 +180,44 @@
275 <!-- AJAX_START -->
276 <?php
277 if($_GET['control']=="userinfo"||$_GET['control']=="useredit") {
278- //Load system/user_props.php
279- require_once('system/user_props.php');
280+ //Load system_local/user_props.php
281+ require_once('system_local/user_props.php');
282 }
283 else if($_GET['control']=="logs") {
284- //Load system/logs.php
285- require_once('system/logs.php');
286+ //Load system_local/logs.php
287+ require_once('system_local/logs.php');
288 }
289 else if($_GET['control']=="desktop") {
290- //Load system/desktop.php
291- require_once('system/desktop.php');
292+ //Load system_local/desktop.php
293+ require_once('system_local/desktop.php');
294 }
295 else if($_GET['control']=="mail") {
296- //Load system/mail.php
297- require_once('system/mail.php');
298+ //Load system_local/mail.php
299+ require_once('system_local/mail.php');
300 }
301 else if($_GET['control']=="getsysusers") {
302- //Load system/get_sys_users.php
303- require_once('system/get_sys_users.php');
304- }
305- else if($_GET['control']=="cms") {
306- //Load system/cms.php
307- require_once('system/cms.php');
308- }
309- else if($_GET['control']=="addons") {
310- require_once('system/plugins/init.php'); //Load APIs
311- if(!isset($_GET['aref'])) $_GET['aref']='';
312- //Load system/plugins/?????.php
313- if(!require_once('system/plugins/'.$_GET['aref'].'/default.php')) { exit; }
314+ //Load system_local/get_sys_users.php
315+ require_once('system_local/get_sys_users.php');
316 }
317 else if($_GET['control']=="login") {
318 //Load login module
319- require_once('system/auth/login.php');
320+ require_once('system_local/auth/login.php');
321 }
322 else if($_GET['control']=="logoff") {
323 //Load logoff module
324- require_once('system/auth/logoff.php');
325+ require_once('system_local/auth/logoff.php');
326 }
327 else if($_GET['control']=="register") {
328 //Load register module
329- require_once('system/register.php');
330+ require_once('system_local/register.php');
331 }
332 else if($_GET['control']=="admin") {
333 //Load admin module
334- if(!RDB) require_once('system/admin-admin.php');
335- else require_once('system/database.php');
336- }
337- else if($_GET['control']=="create_site") {
338- //Load site creation module
339- require_once('system/create_site.php');
340+ require_once('system_local/admin-admin.php');
341 }
342 else if($_GET['control']=="database") {
343- //Load external database module
344- require_once('system/database.php');
345+ //Load add database module
346+ require_once('system_local/database.php');
347 }
348 }?>
349 <!-- AJAX_STOP --></body></html>
350
351=== added file 'remote_panel.php'
352--- remote_panel.php 1970-01-01 00:00:00 +0000
353+++ remote_panel.php 2011-03-30 16:10:37 +0000
354@@ -0,0 +1,220 @@
355+<?php //@./remote_panel.php ?>
356+<?php
357+define('__DEBUG__',true);
358+/**
359+ * remote_panel.php - Main script
360+ * This file is called from the webbrowser when using RemoteCP to connect to a remote database.
361+ */
362+require('inc/controllers.php');
363+require_once('inc/rdb/rdb.php');
364+require_once('inc/accountlevels.php');
365+$t->addFile(__FILE__);
366+//Basic HTML start
367+?>
368+<!DOCTYPE html>
369+<html><head>
370+<title>Remote CP</title>
371+<style type="text/css">
372+html {width: 100%; height: 100%; left:0; right: 0; top:0; bottom:0;}
373+body {font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; font-size: 14px;}
374+</style>
375+<link type="text/css" href="<?php echo URL_JQUERY; ?>/css/jquery-ui.css" rel="stylesheet">
376+<script language='JavaScript' src='<?php echo DOMAIN; ?>/scripts.js'></script>
377+<script language="JavaScript" type="application/javascript">
378+var URL_SCRIPTS="<?php echo URL_SCRIPTS; ?>"; //PHP Constant URL_SCRIPTS
379+</script>
380+<script>
381+ function openusers(element) {
382+ element.id='uid_'+Math.random();
383+ selectuser=open('?control=getsysusers&id='+element.id,'userselect','resizable=no,width=200,height=400'); selectuser.opener=self;
384+ }
385+</script>
386+<?php
387+
388+
389+if(!isset($_GET['control'])) { ?>
390+ <style type="text/css">
391+ body{ font: 62.5% "Trebuchet MS", sans-serif; margin: 0 50px;}
392+ #tabs li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 0; cursor: pointer; }
393+ #tabs div a {cursor: pointer; text-decoration: underline; color: blue;}
394+ .ui-progressbar-value { background-image: url(<?php echo URL_JQUERY; ?>/images/pbar-ani.gif); }
395+ .ui-sortable { list-style: none; padding: 1 em;}
396+ </style>
397+ <script language="JavaScript">
398+ window.onerror=function(msg, url, line) {$('#dlg_js-e').dialog('open'); $('#dlg_js-e').append('<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;"><p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>Fout beschrijving: <tt>!JS['+url+':'+line+'::'+msg+']!</tt></p></div>')}
399+ var loaded_scripts=new Array();
400+ loaded_scripts.push('NULL');
401+ </script>
402+
403+ <script language="JavaScript">
404+ var open_tabs=new Array();
405+ var tab_loc=new Array();
406+ tab_loc['tabs-desktop']='?control=desktop';
407+ open_tabs[0]='tabs-desktop';
408+ var $tabs;
409+ var logged_in = false;
410+
411+ $(function(){
412+ // GUI classes
413+ $('.gui-dlg').dialog({
414+ autoOpen: false,
415+ width: 600,
416+ show: 'puff',
417+ hide: 'fold'
418+ });
419+
420+ $('.gui-dlg-alert').dialog({
421+ resizable: false,
422+ draggable: false,
423+ buttons: {
424+ "Ok": function() {
425+ $(this).dialog("close");
426+ }
427+ }
428+ });
429+ $('.gui-dlg-fs').dialog({ modal: true});
430+ $('.gui-dlg-noresize').dialog({ resizable: false});
431+
432+ $('.gui-button').button();
433+
434+
435+
436+ // Tab templates... DO NOT EDIT
437+ $tabs = $('#tabs').tabs({
438+ tabTemplate: '<li><a href="#{href}" >#{label}</a> <span class="ui-icon ui-icon-close">Remove Tab</span></li>',
439+ add: function(event, ui) {
440+ $(ui.panel).append('');
441+ $tabs.tabs('select', '#' + ui.panel.id);
442+ }
443+ });
444+
445+ // close icon: removing the tab on click
446+ // note: closable tabs gonna be an option in the future - see http://dev.jqueryui.com/ticket/3924
447+ $('#tabs span.ui-icon-close').live('click', function() {
448+ var index = $('li',$tabs).index($(this).parent());
449+ var href=document.getElementById('tabs').getElementsByTagName('a')[index].href;
450+ open_tabs.key_unset(href.substring(href.indexOf('#')+1));
451+ tab_loc[href.substring(href.indexOf('#')+1)]="";
452+ $tabs.tabs('remove', index);
453+ //open_tabs.key_unset(index);
454+ });
455+ $('.gui-progress').progressbar({value: 100});
456+
457+ });
458+ //addTab function.
459+ /**********************
460+ Spec:
461+ *title: Tab title
462+ *content: Tab content. [Can be ajax request]
463+ * ->e.g.: *addTab('title',ajax.get(url));* OR *addTab('title'),ajax.post(url,post_parameters));*
464+ ***********************/
465+ function addTab(title, content, ref) {
466+ if(!open_tabs.in_array(ref)){
467+ $tabs.tabs('add', '#'+ref, title);
468+ open_tabs.push(ref);
469+ document.getElementById(ref).innerHTML=content;
470+ }
471+ $tabs.tabs('select','#'+ref);
472+ }
473+ function openLoc(title,url,tab) {
474+ tab_loc[tab]=url;
475+ addTab(title,'<div class="gui-progress"><'+'/div>',tab);
476+ $('.gui-progress').progressbar({value: 100});
477+ //$.getScript(url+'&getscript');
478+ document.getElementById(tab).innerHTML=ajax.get(url);
479+ }
480+ function refreshLoc() {
481+ for (i=0;i<open_tabs.length;i++) {
482+ document.getElementById(open_tabs[i]).innerHTML=ajax.get(tab_loc[open_tabs[i]]);
483+ }
484+ }
485+ function refreshCurrentTab(){
486+ tid=document.getElementById('tabs').children[$tabs.tabs('option','selected')+1].id
487+ document.getElementById(tid).innerHTML=ajax.get(tab_loc[tid]);
488+ }
489+ function closeCurrentTab(){
490+ var index=$tabs.tabs('option','selected');
491+ var href=document.getElementById('tabs').getElementsByTagName('a')[index].href;
492+ open_tabs.key_unset(href.substring(href.indexOf('#')+1));
493+ tab_loc[href.substring(href.indexOf('#')+1)]="";
494+ $tabs.tabs('remove', index);
495+ }
496+
497+ </script>
498+
499+ </head>
500+ <body>
501+ <div id="tabs">
502+ <ul>
503+
504+ <li><a href="#tabs-desktop"><?php echo $t->_('Desktop'); ?></a></li>
505+ </ul>
506+ <div id="tabs-desktop">
507+ <div class='gui-progress'></div>
508+ </div>
509+ </div>
510+ <div id="dlg_js-e" title="JavaScript ERROR" class="gui-dlg gui-dlg-fs gui-dlg-alert">
511+ <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span><?php echo $t->_('An error occured in your browser\'s JavaScript interpreter.</p><p>Probably the page doesn\'t work anymore.'); ?></p></div>
512+ </div>
513+ <script language="JavaScript">
514+ //Initialize desktop
515+ document.getElementById('tabs-desktop').innerHTML=ajax.get('?control=desktop');
516+ </script>
517+ </body>
518+ </html>
519+<?php }
520+else {
521+ if(!$session->logged_in&&!($_GET['control']=="login"||$_GET['control']=="register")) { //Not logged in & not registering & not logging in
522+?>
523+<!-- AJAX_START --><!-- HEADERS >
524+<AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
525+<AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
526+< HEADERS -->
527+<div class="ui-state-highlight ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
528+<?php echo $t->_('<strong>Authentication expired</strong> You were too long inactive. Your session has expired.'); ?></p><p><span aria-disabled="false" role="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" onclick="parent.$('#dlg_log-in').dialog('open');"><span class="ui-button-text"><?php echo $t->_('Relogin'); ?></span></span>
529+</p></div>
530+<!-- AJAX_STOP --><?php
531+ exit;
532+ }
533+ elseif(!$rdb_auth->logged_in) { //Not authenticated to access the database
534+?>
535+<!-- AJAX_START --><!-- HEADERS >
536+<AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
537+<AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
538+< HEADERS -->
539+<div class="ui-state-highlight ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
540+<?php echo $t->_('<strong>Access denied</strong> You are not allowed to access this database.'); ?></p>
541+</p></div>
542+<!-- AJAX_STOP --><?php
543+ exit;
544+ }
545+?>
546+</head><body>
547+<!-- AJAX_START -->
548+<?php
549+ if($_GET['control']=="desktop") {
550+ //Load system_remote/desktop.php
551+ require_once('system_remote/desktop.php');
552+ }
553+ else if($_GET['control']=="addons") {
554+ require_once('system_remote/plugins/init.php'); //Load APIs
555+ if(!isset($_GET['aref'])) $_GET['aref']='';
556+ //Load system_remote/plugins/?????.php
557+ if(!require_once('system_remote/plugins/'.$_GET['aref'].'/default.php')) { exit; }
558+ }
559+ else if($_GET['control']=="admin") {
560+ require_once('system_remote/database.php');
561+ }
562+ else if($_GET['control']=="create_site") {
563+ //Load site creation module
564+ require_once('system_remote/create_site.php');
565+ }
566+}?>
567+<!-- AJAX_STOP --></body></html>
568+<?php
569+//Save sqlsess
570+$sess->save_session($_SESSION);
571+
572+ //PAGE END
573+?>
574+<!-- ==notification== page parsed by PHP (php.net) -->
575\ No newline at end of file
576
577=== modified file 'scripts/parse_js.php'
578--- scripts/parse_js.php 2011-03-12 12:53:09 +0000
579+++ scripts/parse_js.php 2011-03-30 16:10:37 +0000
580@@ -16,7 +16,7 @@
581 else {
582 if(!file_exists($_GET['u'].'.js.php')) {
583 if(substr($_GET['u'],0,2)=='a_') {
584- chdir('../system/plugins');
585+ chdir('../system_remote/plugins');
586 $parts=explode('_',$_GET['u']);
587 if($parts[1]!='') $parts[1].='/';
588 if(file_exists($parts[1].'scripts.php')) {
589
590=== modified file 'scripts/permanent/ajax.js'
591--- scripts/permanent/ajax.js 2011-03-14 20:07:21 +0000
592+++ scripts/permanent/ajax.js 2011-03-30 16:10:37 +0000
593@@ -21,7 +21,8 @@
594 return resp;
595 }
596 else if(page.status==500) {
597- console.error(resp);
598+ console.error('AJAX returned 500');
599+ console.debug(page.responseText);
600 return 'false|PHP error';
601 }
602 else if(resp=='') {
603@@ -46,7 +47,8 @@
604 return resp;
605 }
606 else if(page.status==500) {
607- console.error(resp);
608+ console.error('AJAX returned 500');
609+ console.debug(page.responseText);
610 return 'false|PHP error';
611 }
612 else if(resp=='') {
613
614=== renamed directory 'system' => 'system_local'
615=== modified file 'system_local/admin-admin.php'
616--- system/admin-admin.php 2011-03-05 13:03:30 +0000
617+++ system_local/admin-admin.php 2011-03-30 16:10:37 +0000
618@@ -1,4 +1,4 @@
619-<?php //@./system/admin-admin.php ?>
620+<?php //@./system_local/admin-admin.php ?>
621 <!-- HEADERS >
622 <AJAX_SCRIPTLOC>admin_scripts.js</AJAX_SCRIPTLOC>
623 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
624
625=== modified file 'system_local/auth/login.php'
626--- system/auth/login.php 2011-01-30 17:23:45 +0000
627+++ system_local/auth/login.php 2011-03-30 16:10:37 +0000
628@@ -1,4 +1,4 @@
629-<?php //@./system/auth/login.php ?>
630+<?php //@./system_local/auth/login.php ?>
631 <!-- HEADERS >
632 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
633 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
634
635=== modified file 'system_local/auth/logoff.php'
636--- system/auth/logoff.php 2011-01-30 17:23:45 +0000
637+++ system_local/auth/logoff.php 2011-03-30 16:10:37 +0000
638@@ -1,4 +1,4 @@
639-<?php //@./system/auth/logoff.php ?>
640+<?php //@./system_local/auth/logoff.php ?>
641 <!-- HEADERS >
642 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
643 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
644
645=== modified file 'system_local/create_site.php'
646--- system/create_site.php 2011-03-12 20:51:51 +0000
647+++ system_local/create_site.php 2011-03-30 16:10:37 +0000
648@@ -1,4 +1,4 @@
649-<?php //@./system/create_site.php ?>
650+<?php //@./system_local/create_site.php ?>
651 <!-- HEADERS >
652 <AJAX_SCRIPTLOC>create_site_scripts.js</AJAX_SCRIPTLOC>
653 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
654
655=== modified file 'system_local/database.php'
656--- system/database.php 2011-02-02 19:15:56 +0000
657+++ system_local/database.php 2011-03-30 16:10:37 +0000
658@@ -1,4 +1,4 @@
659-<?php //@./system/database.php ?>
660+<?php //@./system_local/database.php ?>
661 <!-- HEADERS >
662 <AJAX_SCRIPTLOC>db_scripts.js</AJAX_SCRIPTLOC>
663 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
664@@ -6,16 +6,15 @@
665 /**
666 * database.php - Administrate a database
667 * This file is used to add a new database to RemoteCP
668- * and to administer this.
669 */
670 function help($iname) {
671 global $t;
672 return "<a onclick='db.create.question(\"$iname\");'><img src='".URL_IMG."/Silk/help.png' alt='?' title='".$t->_('Help')."'></a>";
673 }
674-if(!RDB&&!isset($_GET['function'])) //We are not in a remote database
675+if(!isset($_GET['function']))
676 $_GET['function']='create';
677
678-if(!RDB&&$_GET['function']=='create') {
679+if($_GET['function']=='create') {
680 if(!isset($_POST['conn_host'])) {
681 echo "
682 <form method='POST' onsubmit='db.create.send(this); return false'>
683@@ -75,108 +74,6 @@
684 }
685 }
686 }
687-else if(RDB&&$_GET['control']=='admin'&&$remote_session->isAdmin()) {
688- if(!isset($_GET['function'])) {
689- $settingsq=$local_connection->query('SELECT * FROM `remote_databases` WHERE `key`="'.$remote_session->dbkey.'"');
690- $settings=$settingsq->fetch_assoc();
691- ?>
692- <fieldset>
693- <legend><?php echo $t->_('Settings'); ?></legend>
694- <form method='POST' onsubmit='db.admin.settings.send(this); return false'>
695- <fieldset>
696- <legend><?php echo $t->_('Connection'); ?></legend>
697- <label><input name='conn_type' type='radio' value='0' onclick='$(this.parentNode.parentNode.getElementsByTagName("fieldset")[0]).show("slow");$(this.parentNode.parentNode.getElementsByTagName("fieldset")[1]).hide("slow")' <?php echo ($settings['accesstype']==0)?'checked':''; ?>><?php echo $t->_('Normal'); ?></label> <label><input name='conn_type' type='radio' value='1' onclick='$(this.parentNode.parentNode.getElementsByTagName("fieldset")[1]).show("slow");$(this.parentNode.parentNode.getElementsByTagName("fieldset")[0]).hide("slow")' <?php echo ($settings['accesstype']==1)?'checked':''; ?>><?php echo $t->_('HTTPMySQL'); ?></label> <?php echo help('conn_type'); ?><br>
698- <fieldset style='<?php echo ($settings['accesstype']==1)?'display: none':''; ?>'>
699- <legend><?php echo $t->_('MySQL'); ?></legend>
700- <label><?php echo $t->_('MySQL host'); ?>: <input name='conn_0_host' type='text' value='<?php echo $settings['host']; ?>'></label> <?php echo help('conn_0_host'); ?><br>
701- <label><?php echo $t->_('MySQL username'); ?>: <input name='conn_0_user' type='text' value='<?php echo $settings['user']; ?>'></label><br>
702- <label><?php echo $t->_('MySQL password'); ?>: <input name='conn_0_pass' type='password' value='<?php echo $settings['password']; ?>'></label><br>
703- <label><?php echo $t->_('MySQL database'); ?>: <input name='conn_0_db' type='text' value='<?php echo $settings['database']; ?>'></label>
704- </fieldset>
705- <fieldset style='<?php echo ($settings['accesstype']==0)?'display: none':''; ?>'>
706- <legend><?php echo $t->_('HTTPMySQL'); ?></legend>
707- <label><?php echo $t->_('Domain'); ?>: <input name='conn_1_host' type='text' value='<?php echo $settings['host']; ?>'></label> <?php echo help('conn_1_host'); ?><br>
708- <label><?php echo $t->_('Path to query.php'); ?>: <input name='conn_1_db' type='text' value='<?php echo $settings['database']; ?>'></label>/query.php <?php echo help('conn_1_db'); ?><br>
709- <label><?php echo $t->_('Username'); ?>: <input name='conn_1_user' type='text' value='<?php echo $settings['user']; ?>'></label> <?php echo help('conn_1_user'); ?><br>
710- <label><?php echo $t->_('Password'); ?>: <input name='conn_1_pass' type='password' value='<?php echo $settings['password']; ?>'></label> <?php echo help('conn_1_pass'); ?><br>
711- </fieldset>
712- </fieldset>
713-
714- <input type='submit' value='<?php echo $t->_('Update settings'); ?>'>
715- </form>
716- </fieldset>
717- <fieldset>
718- <legend><?php echo $t->_('Users'); ?></legend>
719- <?php $q=$local_connection->query('SELECT * FROM `remote_databases_assignments` WHERE `key`="'.$remote_session->dbkey.'"') ?>
720- <table><tr><th><?php echo $t->_('User'); ?></th><th><?php echo $t->_('Lv.'); ?></th><th><?php echo $t->_('Delete'); ?></th></tr>
721- <?php while($users=$q->fetch_assoc()) { ?>
722- <tr><td><img src="<?php echo URL_IMG; ?>/Silk/user.png"> <?php echo $users['username']; ?></td><td<?php if($users['username']!=$session->username) {?> ondblclick='db.admin.user.editlvl.expand("<?php echo $users['username']; ?>",this)'<?php } ?>><?php echo $users['level'] ?></td><td><?php if($users['username']!=$session->username) {?><a onclick='db.admin.user.delete("<?php echo $users['username']; ?>")'><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Revoke user privileges'); ?>"></a><?php } ?></td></tr>
723- <?php } ?>
724- <tr><td colspan='3'><img src="<?php echo URL_IMG; ?>/Silk/user_add.png" alt="+" title="<?php echo $t->_('Add user'); ?>"> <input type='text' onclick='openusers(this)'></td><td><a onclick='db.admin.user.add(this);'><img src="<?php echo URL_IMG; ?>/Silk/add.png" alt="<?php echo $t->_('Add'); ?>" title="<?php echo $t->_('Add new user'); ?>"></a></td></tr>
725- </table>
726- </fieldset>
727- <fieldset>
728- <legend><?php echo $t->_('Delete database'); ?></legend>
729- <a onclick='db.admin.delete()'><img src="<?php echo URL_IMG; ?>/Silk/database_delete.png" alt=''><?php echo $t->_('Delete database from the system'); ?></a>
730- <?php
731-}
732-
733- else if($_GET['function']=='editlvl') {
734- if($local_connection->query('UPDATE `remote_databases_assignments` SET `level`='.$_GET['lvl'].' WHERE `username`=\''.$_GET['user'].'\' AND `key`=\''.$remote_session->dbkey.'\'')) {
735- echo "true";
736- }
737- else {
738- echo "false";
739- }
740- }
741- else if($_GET['function']=='deleteuser') {
742- if($local_connection->query('DELETE FROM `remote_databases_assignments` WHERE `username`=\''.$_POST['username'].'\' AND `key`=\''.$remote_session->dbkey.'\'')) {
743- echo "true";
744- }
745- else {
746- echo "false";
747- }
748- }
749- else if($_GET['function']=="adduser") {
750- if(!$database->usernameTaken($_POST['username'])) {
751- echo "false";
752- exit;
753- }
754- if($local_connection->query('INSERT INTO `remote_databases_assignments` VALUES(\''.$remote_session->dbkey.'\',\''.$_POST['username'].'\',1)')) {
755- echo "true";
756- }
757- else {
758- echo "false";
759- }
760- }
761- else if($_GET['function']=='update_settings') {
762- $_ERRORS=array();
763- if($_POST['conn_type']==0) {
764- $db_test=@mysql_connect($_POST['conn_host'],$_POST['conn_user'],$_POST['conn_pass']);
765- if(!@mysql_select_db($_POST['conn_db'],$db_test)) $_ERRORS[]=$t->_('MySQL connection error');
766- }
767- else {
768- include('inc/httpmysql/httpmysql_silent.php');
769- $db_test=@new HTTPMySQL("http://{$_POST['conn_user']}:{$_POST['conn_pass']}@{$_POST['conn_host']}/{$_POST['conn_db']}/query.php");
770- if(!$db_test->ping())$_ERRORS[]=$t->_('HTTPMySQL connection error');
771- }
772- if(count($_ERRORS)!=0) {
773- echo "false|";
774- foreach($_ERRORS as $e) {
775- echo "$e:";
776- }
777- }
778- else {
779- $local_connection->query('UPDATE `remote_databases` SET `host`="'.$_POST['conn_host'].'", `accesstype`='.$_POST['conn_type'].', `user`="'.$_POST['conn_user'].'", `password`="'.$_POST['conn_pass'].'" WHERE `key`="'.$remote_session->dbkey.'"');
780- echo "true";
781- }
782- }
783- else if($_GET['function']=='delete') {
784- $local_connection->query('DELETE FROM `remote_databases` WHERE `key`="'.$remote_session->dbkey.'"');
785- $local_connection->query('DELETE FROM `remote_databases_assignments` WHERE `key`="'.$remote_session->dbkey.'"');
786- echo "true";
787- }
788-}
789 else if($_GET['function']=="help") {
790 $name=$_GET['name'];
791 switch($_GET['name']) {
792
793=== modified file 'system_local/desktop.php'
794--- system/desktop.php 2011-03-05 12:56:10 +0000
795+++ system_local/desktop.php 2011-03-30 16:10:37 +0000
796@@ -1,9 +1,8 @@
797-<?php //@./system/desktop.php ?>
798+<?php //@./system_local/desktop.php ?>
799 <!-- HEADERS >
800 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
801 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
802 < HEADERS -->
803-<?php if(!RDB) { ?>
804 <p>
805 | <a onclick="openLoc('<?php echo $t->_('Account'); ?>','?control=userinfo&user=<?php echo $session->username; ?>','account')"><?php echo $t->_('Account'); ?></a> |<?php
806 if($session->isAdmin()) {?>| <a onclick="openLoc('<?php echo $t->_('Logs'); ?>','?control=logs','logs');"><?php echo $t->_('Logbooks'); ?></a> |<?php }
807@@ -14,19 +13,8 @@
808 <?php
809 $q=$local_connection->query("SELECT * FROM `remote_databases_assignments` WHERE `username`='$session->username'");
810 while($databases=$q->fetch_assoc()) {
811- $db=$local_connection->query("SELECT * FROM `remote_databases` WHERE `key`='$databases[key]'"); $dbinfo=$db->fetch_assoc(); ?>| <a onclick="parent.frames.addFrame('panel.php/<?php echo $databases['key']; ?>/');"><?php echo $dbinfo['user'].'@'.$dbinfo['host'].'/'.$dbinfo['database']; ?></a> |<?php
812+ $db=$local_connection->query("SELECT * FROM `remote_databases` WHERE `key`='$databases[key]'"); $dbinfo=$db->fetch_assoc(); ?>| <a onclick="parent.frames.addFrame('remote_panel.php/<?php echo $databases['key']; ?>/');"><?php echo $dbinfo['user'].'@'.$dbinfo['host'].'/'.$dbinfo['database']; ?></a> |<?php
813 }
814 echo '| <a onclick="openLoc(\''.$t->_('Add database').'\',\'?control=database\',\'add_db\');">'.$t->_('Add database').'</a> |';
815-}
816-else { ?>
817-<?php if(RDB_AUTH==9) {
818- ?>| <a onclick="openLoc('<?php echo $t->_('Administration'); ?>','?control=admin','admin');"><?php echo $t->_('Administration'); ?></a> |
819-<?php
820-}
821 ?>
822-<hr><?php
823- $q=$remote_connection->query('SELECT * FROM sites WHERE username="'.$session->username.'"');
824- while($sites=$q->fetch_assoc()) { ?>| <a onclick="openLoc('<?php echo getSiteInfo($sites['ref'],'SITE_TITLE'); ?>','?control=addons&site=<?php echo $sites['ref']; ?>','<?php echo $sites['ref']; ?>_ctrls_main');"><?php echo getSiteInfo($sites['ref'],'SITE_TITLE'); ?></a> |<?php }
825- echo "| <a onclick=\"openLoc('".$t->_('New site')."','?control=create_site','new_site');\">".$t->_('New site')."</a> |";
826-} ?>
827 </p>
828\ No newline at end of file
829
830=== modified file 'system_local/get_sys_users.php'
831--- system/get_sys_users.php 2011-01-30 17:23:45 +0000
832+++ system_local/get_sys_users.php 2011-03-30 16:10:37 +0000
833@@ -1,4 +1,4 @@
834-<?php //@./system/get_sys_users.php ?>
835+<?php //@./system_local/get_sys_users.php ?>
836 <!-- HEADERS >
837 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
838 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
839
840=== modified file 'system_local/login.php'
841--- system/login.php 2011-01-30 17:23:45 +0000
842+++ system_local/login.php 2011-03-30 16:10:37 +0000
843@@ -1,4 +1,4 @@
844-<?php //@./system/login.php ?>
845+<?php //@./system_local/login.php ?>
846 <!-- HEADERS >
847 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
848 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
849
850=== modified file 'system_local/logs.php'
851--- system/logs.php 2011-01-30 17:23:45 +0000
852+++ system_local/logs.php 2011-03-30 16:10:37 +0000
853@@ -1,4 +1,4 @@
854-<?php //@./system/logs.php ?>
855+<?php //@./system_local/logs.php ?>
856 <!-- HEADERS >
857 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
858 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
859
860=== modified file 'system_local/mail.php'
861--- system/mail.php 2011-01-30 17:23:45 +0000
862+++ system_local/mail.php 2011-03-30 16:10:37 +0000
863@@ -1,4 +1,4 @@
864-<?php //@./system/mail.php ?>
865+<?php //@./system_local/mail.php ?>
866 <!-- HEADERS >
867 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
868 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
869
870=== modified file 'system_local/register.php'
871--- system/register.php 2011-01-30 17:23:45 +0000
872+++ system_local/register.php 2011-03-30 16:10:37 +0000
873@@ -1,4 +1,4 @@
874-<?php //@./system/register.php ?>
875+<?php //@./system_local/register.php ?>
876 <!-- HEADERS >
877 <AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
878 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
879
880=== modified file 'system_local/user_props.php'
881--- system/user_props.php 2011-03-14 20:13:50 +0000
882+++ system_local/user_props.php 2011-03-30 16:10:37 +0000
883@@ -1,4 +1,4 @@
884-<?php //@./system/user_props.php ?>
885+<?php //@./system_local/user_props.php ?>
886 <!-- HEADERS >
887 <AJAX_SCRIPTLOC>account_scripts.js</AJAX_SCRIPTLOC>
888 <AJAX_SCRIPTEVAL>setTimeout('$("#user_edit_language").sortable().removeClass("ui-state-disabled");',1)</AJAX_SCRIPTEVAL>
889
890=== added directory 'system_remote'
891=== added file 'system_remote/database.php'
892--- system_remote/database.php 1970-01-01 00:00:00 +0000
893+++ system_remote/database.php 2011-03-30 16:10:37 +0000
894@@ -0,0 +1,152 @@
895+<?php //@./system_remote/database.php ?>
896+<!-- HEADERS >
897+<AJAX_SCRIPTLOC>db_scripts.js</AJAX_SCRIPTLOC>
898+<AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
899+< HEADERS --><?php
900+/**
901+ * database.php - Administrate a database
902+ * This file is used to administer a remote database
903+ */
904+function help($iname) {
905+ global $t;
906+ return "<a onclick='db.create.question(\"$iname\");'><img src='".URL_IMG."/Silk/help.png' alt='?' title='".$t->_('Help')."'></a>";
907+}
908+
909+if($rdb_auth->level==9) {
910+ if(!isset($_GET['function'])) {
911+ $settingsq=$local_connection->query('SELECT * FROM `remote_databases` WHERE `key`="'.$remote_session->dbkey.'"');
912+ $settings=$settingsq->fetch_assoc();
913+ ?>
914+ <fieldset>
915+ <legend><?php echo $t->_('Settings'); ?></legend>
916+ <form method='POST' onsubmit='db.admin.settings.send(this); return false'>
917+ <fieldset>
918+ <legend><?php echo $t->_('Connection'); ?></legend>
919+ <label><input name='conn_type' type='radio' value='0' onclick='$(this.parentNode.parentNode.getElementsByTagName("fieldset")[0]).show("slow");$(this.parentNode.parentNode.getElementsByTagName("fieldset")[1]).hide("slow")' <?php echo ($settings['accesstype']==0)?'checked':''; ?>><?php echo $t->_('Normal'); ?></label> <label><input name='conn_type' type='radio' value='1' onclick='$(this.parentNode.parentNode.getElementsByTagName("fieldset")[1]).show("slow");$(this.parentNode.parentNode.getElementsByTagName("fieldset")[0]).hide("slow")' <?php echo ($settings['accesstype']==1)?'checked':''; ?>><?php echo $t->_('HTTPMySQL'); ?></label> <?php echo help('conn_type'); ?><br>
920+ <fieldset style='<?php echo ($settings['accesstype']==1)?'display: none':''; ?>'>
921+ <legend><?php echo $t->_('MySQL'); ?></legend>
922+ <label><?php echo $t->_('MySQL host'); ?>: <input name='conn_0_host' type='text' value='<?php echo $settings['host']; ?>'></label> <?php echo help('conn_0_host'); ?><br>
923+ <label><?php echo $t->_('MySQL username'); ?>: <input name='conn_0_user' type='text' value='<?php echo $settings['user']; ?>'></label><br>
924+ <label><?php echo $t->_('MySQL password'); ?>: <input name='conn_0_pass' type='password' value='<?php echo $settings['password']; ?>'></label><br>
925+ <label><?php echo $t->_('MySQL database'); ?>: <input name='conn_0_db' type='text' value='<?php echo $settings['database']; ?>'></label>
926+ </fieldset>
927+ <fieldset style='<?php echo ($settings['accesstype']==0)?'display: none':''; ?>'>
928+ <legend><?php echo $t->_('HTTPMySQL'); ?></legend>
929+ <label><?php echo $t->_('Domain'); ?>: <input name='conn_1_host' type='text' value='<?php echo $settings['host']; ?>'></label> <?php echo help('conn_1_host'); ?><br>
930+ <label><?php echo $t->_('Path to query.php'); ?>: <input name='conn_1_db' type='text' value='<?php echo $settings['database']; ?>'></label>/query.php <?php echo help('conn_1_db'); ?><br>
931+ <label><?php echo $t->_('Username'); ?>: <input name='conn_1_user' type='text' value='<?php echo $settings['user']; ?>'></label> <?php echo help('conn_1_user'); ?><br>
932+ <label><?php echo $t->_('Password'); ?>: <input name='conn_1_pass' type='password' value='<?php echo $settings['password']; ?>'></label> <?php echo help('conn_1_pass'); ?><br>
933+ </fieldset>
934+ </fieldset>
935+
936+ <input type='submit' value='<?php echo $t->_('Update settings'); ?>'>
937+ </form>
938+ </fieldset>
939+ <fieldset>
940+ <legend><?php echo $t->_('Users'); ?></legend>
941+ <?php $q=$local_connection->query('SELECT * FROM `remote_databases_assignments` WHERE `key`="'.$remote_session->dbkey.'"') ?>
942+ <table><tr><th><?php echo $t->_('User'); ?></th><th><?php echo $t->_('Lv.'); ?></th><th><?php echo $t->_('Delete'); ?></th></tr>
943+ <?php while($users=$q->fetch_assoc()) { ?>
944+ <tr><td><img src="<?php echo URL_IMG; ?>/Silk/user.png"> <?php echo $users['username']; ?></td><td<?php if($users['username']!=$session->username) {?> ondblclick='db.admin.user.editlvl.expand("<?php echo $users['username']; ?>",this)'<?php } ?>><?php echo $users['level'] ?></td><td><?php if($users['username']!=$session->username) {?><a onclick='db.admin.user.delete("<?php echo $users['username']; ?>")'><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Revoke user privileges'); ?>"></a><?php } ?></td></tr>
945+ <?php } ?>
946+ <tr><td colspan='3'><img src="<?php echo URL_IMG; ?>/Silk/user_add.png" alt="+" title="<?php echo $t->_('Add user'); ?>"> <input type='text' onclick='openusers(this)'></td><td><a onclick='db.admin.user.add(this);'><img src="<?php echo URL_IMG; ?>/Silk/add.png" alt="<?php echo $t->_('Add'); ?>" title="<?php echo $t->_('Add new user'); ?>"></a></td></tr>
947+ </table>
948+ </fieldset>
949+ <fieldset>
950+ <legend><?php echo $t->_('Delete database'); ?></legend>
951+ <a onclick='db.admin.delete()'><img src="<?php echo URL_IMG; ?>/Silk/database_delete.png" alt=''><?php echo $t->_('Delete database from the system'); ?></a>
952+ <?php
953+}
954+
955+ else if($_GET['function']=='editlvl') {
956+ if($local_connection->query('UPDATE `remote_databases_assignments` SET `level`='.$_GET['lvl'].' WHERE `username`=\''.$_GET['user'].'\' AND `key`=\''.$remote_session->dbkey.'\'')) {
957+ echo "true";
958+ }
959+ else {
960+ echo "false";
961+ }
962+ }
963+ else if($_GET['function']=='deleteuser') {
964+ if($local_connection->query('DELETE FROM `remote_databases_assignments` WHERE `username`=\''.$_POST['username'].'\' AND `key`=\''.$remote_session->dbkey.'\'')) {
965+ echo "true";
966+ }
967+ else {
968+ echo "false";
969+ }
970+ }
971+ else if($_GET['function']=="adduser") {
972+ if(!$database->usernameTaken($_POST['username'])) {
973+ echo "false";
974+ exit;
975+ }
976+ if($local_connection->query('INSERT INTO `remote_databases_assignments` VALUES(\''.$remote_session->dbkey.'\',\''.$_POST['username'].'\',1)')) {
977+ echo "true";
978+ }
979+ else {
980+ echo "false";
981+ }
982+ }
983+ else if($_GET['function']=='update_settings') {
984+ $_ERRORS=array();
985+ if($_POST['conn_type']==0) {
986+ $db_test=@mysql_connect($_POST['conn_host'],$_POST['conn_user'],$_POST['conn_pass']);
987+ if(!@mysql_select_db($_POST['conn_db'],$db_test)) $_ERRORS[]=$t->_('MySQL connection error');
988+ }
989+ else {
990+ include('inc/httpmysql/httpmysql_silent.php');
991+ $db_test=@new HTTPMySQL("http://{$_POST['conn_user']}:{$_POST['conn_pass']}@{$_POST['conn_host']}/{$_POST['conn_db']}/query.php");
992+ if(!$db_test->ping())$_ERRORS[]=$t->_('HTTPMySQL connection error');
993+ }
994+ if(count($_ERRORS)!=0) {
995+ echo "false|";
996+ foreach($_ERRORS as $e) {
997+ echo "$e:";
998+ }
999+ }
1000+ else {
1001+ $local_connection->query('UPDATE `remote_databases` SET `host`="'.$_POST['conn_host'].'", `accesstype`='.$_POST['conn_type'].', `user`="'.$_POST['conn_user'].'", `password`="'.$_POST['conn_pass'].'" WHERE `key`="'.$remote_session->dbkey.'"');
1002+ echo "true";
1003+ }
1004+ }
1005+ else if($_GET['function']=='delete') {
1006+ $local_connection->query('DELETE FROM `remote_databases` WHERE `key`="'.$remote_session->dbkey.'"');
1007+ $local_connection->query('DELETE FROM `remote_databases_assignments` WHERE `key`="'.$remote_session->dbkey.'"');
1008+ echo "true";
1009+ }
1010+}
1011+else if($_GET['function']=="help") {
1012+ $name=$_GET['name'];
1013+ switch($_GET['name']) {
1014+ case 'conn_type':
1015+ echo "<h1>".$t->_('Connection')."</h1>";
1016+ echo $t->_('<p>How should RemoteCP connect to your database?</p><p>Normal mode is preferred, but you have to be able to allow remote hosts to connect to your MySQL server. (Probably named \'Remote MySQL\' or \'Remote database access\' )</p><p>When it is not possible to choose sites who are allowed to connect to your database, you have to choose \'HTTPMySQL\'. However, this is a bit slower and requires more processing power on your server.</p>');
1017+ break;
1018+ case 'conn_0_host':
1019+ echo "<script>var db ={ create: {question: function(formname) { window.open('?control=database&function=help&name='+formname,'database_help','resizable=no,width=800,height=200')}}}</script>";
1020+ echo "<h1>".$t->_('MySQL host')."</h1>";
1021+ echo sprintf($t->_('<p>The machine that runs the MySQL server</p><p>If this is \'localhost\' or \'127.0.0.1\' according to your documentation, you should enter your domainname %s here.'),help('conn_1_host'));
1022+ break;
1023+ case 'conn_1_host':
1024+ echo "<h1>".$t->_('Domain')."</h1>";
1025+ echo $t->_('<p>Your domain is what you type to visit your website</p><p>It is placed behind http:// and before the first slash. (E.g.: <tt>http://<u>remotecp.co.cc</u>/1-Home/</tt>, <tt>remotecp.co.cc</tt> is the domain).</p>');
1026+ break;
1027+ case 'conn_1_db':
1028+ echo "<script>var db ={ create: {question: function(formname) { window.open('?control=database&function=help&name='+formname,'database_help','resizable=no,width=800,height=200')}}}</script>";
1029+ echo "<h1>".$t->_('Path to query.php')."</h1>";
1030+ echo sprintf($t->_('<p>The path to the file query.php on your server.</p><p>The path is the part after the domain %s. For your convenience, whe have already appended \'/query.php\'. So, you must also omit that from the path.</p>'),help('conn_1_host'));
1031+ break;
1032+ case 'conn_1_user':
1033+ echo "<h1>".$t->_('Username')."</h1>";
1034+ echo $t->_('<p>What username is required to access \'query.php\'?</p><p>You should secure query.php with an username and password combination to avoid unallowed changes to your websites. What username did you use for that purpose?</p>');
1035+ break;
1036+ case 'conn_1_pass':
1037+ echo "<h1>".$t->_('Password')."</h1>";
1038+ echo $t->_('<p>What password is required to access \'query.php\'?</p><p>You should secure query.php with an username and password combination to avoid unallowed changes to your websites. What password did you use for that purpose?</p>');
1039+ break;
1040+ case 'api_ip':
1041+ echo "<script>var db ={ create: {question: function(formname) { window.open('?control=database&function=help&name='+formname,'database_help','resizable=no,width=800,height=200')}}}</script>";
1042+ echo "<h1>".$t->_('IP-address')."</h1>";
1043+ echo sprintf($t->_('<p>What is the IP-address belonging to your server?</p><p>An IP address is a unique identifier of 4 times a number from 0 to 255, separated by a point. (E.g.:<tt><u>69.175.113.125</u></tt>)</p><p>To find the IP address of your server open a Command Prompt window (Folder Accessories) and type <tt>ping &lt;domain %s &gt; </tt>. The first rule is roughly <tt> Pinging remotecp.co.cc [<u>199.27.134.101</u>] with 32 bytes of data: </tt>. The underlined part is the IP address of your server. </p>'),help('conn_1_host'));
1044+ }
1045+
1046+}
1047\ No newline at end of file
1048
1049=== added file 'system_remote/desktop.php'
1050--- system_remote/desktop.php 1970-01-01 00:00:00 +0000
1051+++ system_remote/desktop.php 2011-03-30 16:10:37 +0000
1052@@ -0,0 +1,16 @@
1053+<?php //@./system_remote/desktop.php ?>
1054+<!-- HEADERS >
1055+<AJAX_SCRIPTLOC>NULL</AJAX_SCRIPTLOC>
1056+<AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
1057+< HEADERS -->
1058+<?php if($rdb_auth->level==9) {
1059+ ?>| <a onclick="openLoc('<?php echo $t->_('Administration'); ?>','?control=admin','admin');"><?php echo $t->_('Administration'); ?></a> |
1060+<?php
1061+}
1062+?>
1063+<hr><?php
1064+ $q=$remote_connection->query('SELECT * FROM sites WHERE username="'.$session->username.'"');
1065+ while($sites=$q->fetch_assoc()) { ?>| <a onclick="openLoc('<?php echo getSiteInfo($sites['ref'],'SITE_TITLE'); ?>','?control=addons&site=<?php echo $sites['ref']; ?>','<?php echo $sites['ref']; ?>_ctrls_main');"><?php echo getSiteInfo($sites['ref'],'SITE_TITLE'); ?></a> |<?php }
1066+ echo "| <a onclick=\"openLoc('".$t->_('New site')."','?control=create_site','new_site');\">".$t->_('New site')."</a> |";
1067+ ?>
1068+</p>
1069\ No newline at end of file
1070
1071=== renamed directory 'system/plugins' => 'system_remote/plugins'
1072=== modified file 'system_remote/plugins/api.php'
1073--- system/plugins/api.php 2011-01-30 17:23:45 +0000
1074+++ system_remote/plugins/api.php 2011-03-30 16:10:37 +0000
1075@@ -1,4 +1,4 @@
1076-<?php //@./system/plugins/api.php ?>
1077+<?php //@./system_remote/plugins/api.php ?>
1078 <?php
1079 class addons {
1080 static function installed($ref) {
1081@@ -6,13 +6,13 @@
1082 return ($remote_connection->query('SELECT * FROM `'.SITE.'_addons` WHERE `reference`=\''.$ref.'\' AND `status`=1')->num_rows==1);
1083 }
1084 static function available($ref) {
1085- if(!is_dir('system/plugins/'.$ref)) return false;
1086- if(!file_exists('system/plugins/'.$ref.'/default.php')) return false;
1087+ if(!is_dir('system_remote/plugins/'.$ref)) return false;
1088+ if(!file_exists('system_remote/plugins/'.$ref.'/default.php')) return false;
1089 return true;
1090 }
1091 static function installable($ref) {
1092- if(!is_dir('system/plugins/'.$ref)) return false;
1093- if(!file_exists('system/plugins/'.$ref.'/install.php')||!file_exists('system/plugins/'.$ref.'/uninstall.php')) return false;
1094+ if(!is_dir('system_remote/plugins/'.$ref)) return false;
1095+ if(!file_exists('system_remote/plugins/'.$ref.'/install.php')||!file_exists('system_remote/plugins/'.$ref.'/uninstall.php')) return false;
1096 return true;
1097 }
1098 }
1099\ No newline at end of file
1100
1101=== modified file 'system_remote/plugins/cms/api.php'
1102--- system/plugins/cms/api.php 2011-01-30 17:23:45 +0000
1103+++ system_remote/plugins/cms/api.php 2011-03-30 16:10:37 +0000
1104@@ -1,4 +1,4 @@
1105-<?php //@./system/plugins/cms/api.php ?>
1106+<?php //@./system_remote/plugins/cms/api.php ?>
1107 <?php
1108 class cms {
1109 static function get_pages() {
1110
1111=== modified file 'system_remote/plugins/cms/default.php'
1112--- system/plugins/cms/default.php 2011-03-14 18:28:28 +0000
1113+++ system_remote/plugins/cms/default.php 2011-03-30 16:10:37 +0000
1114@@ -1,4 +1,4 @@
1115-<?php //@./system/plugins/cms/default.php ?>
1116+<?php //@./system_remote/plugins/cms/default.php ?>
1117 <!-- HEADERS >
1118 <AJAX_SCRIPTLOC>a_cms_scripts.js</AJAX_SCRIPTLOC>
1119 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
1120@@ -11,30 +11,30 @@
1121 * COPYRIGHT 2010 remotecp.co.cc
1122 */
1123
1124- if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.$site.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1125+ if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.SITE.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1126 if(!isset($_GET['function'])) { $_GET['function']="list"; }
1127 if($_GET['function']=="list") {
1128 $pagesq = cms::get_pages();?>
1129 <table><tr><th></th><th colspan="2"><?php echo $t->_('Title'); ?></th><th title="<?php $t->_("Link path"); ?>"><?php $t->_("Link"); ?></th><th><?php $t->_("Actions"); ?></th></tr>
1130 <?php foreach($pagesq as $pages) { ?>
1131- <tr><td <?php if($pages['type']=='0'||$pages['type']=='2') { ?> ondblclick="cms.page.edit_rights.expand('<?php echo $site; ?>','<?php echo $pages['id']; ?>',this,'<?php echo $pages['access']; ?>')"><img src="<?php echo URL_IMG; ?>/Silk/bullet_<?php if($pages['access']==0) { ?>green<?php } else if($pages['access']==1) { ?>orange<?php } else if($pages['access']==2) { ?>red<?php } ?>.png"><?php } else { ?>><img src="<?php echo URL_IMG; ?>/Silk/link.png"><?php } ?></td><td colspan="2" ondblclick="cms.page.edit_title.expand('<?php echo $site; ?>','<?php echo $pages['id']; ?>',this)"><?php echo $pages['page_title']; ?></td><td<?php if($pages['type']=='0'||$pages['type']=='2') { ?>>/<?php echo $pages['id'].'-'.preg_replace('/[^a-zA-Z0-9]/','_',$pages['page_title']); } else { ?> ondblclick="cms.page.edit_link.expand('<?php echo $site; ?>','<?php echo $pages['id']; ?>',this)"><?php echo $pages['link']; }?></td><td><?php if($pages['type']=='0'||$pages['type']=='1') { ?><a onclick="cms.page.delete('<?php echo $site; ?>','<?php echo $pages['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete page'); ?>"></a> <?php } ?><a onclick="cms.page.edit_order.down('<?php echo $site; ?>','<?php echo $pages['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move the page down'); ?>"></a> <a onclick="cms.page.edit_order.up('<?php echo $site; ?>','<?php echo $pages['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move the page up'); ?>"></a> <a onclick="cms.page.visiblity.<?php if($pages['visible']){ echo "off";} else { echo "on";} ?>('<?php echo $site; ?>','<?php echo $pages['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/lightbulb<?php if(!$pages['visible']) { echo "_off";} ?>.png" alt="<?php if($pages['visible']) { echo $t->_('Visible');} else { echo $t->_('Invisible');} ?>" title="<?php if($pages['visible']) { echo $t->_('Make page invisible');} else { echo $t->_('Make page visible');} ?>"></a></td></tr>
1132+ <tr><td <?php if($pages['type']=='0'||$pages['type']=='2') { ?> ondblclick="cms.page.edit_rights.expand('<?php echo SITE; ?>','<?php echo $pages['id']; ?>',this,'<?php echo $pages['access']; ?>')"><img src="<?php echo URL_IMG; ?>/Silk/bullet_<?php if($pages['access']==0) { ?>green<?php } else if($pages['access']==1) { ?>orange<?php } else if($pages['access']==2) { ?>red<?php } ?>.png"><?php } else { ?>><img src="<?php echo URL_IMG; ?>/Silk/link.png"><?php } ?></td><td colspan="2" ondblclick="cms.page.edit_title.expand('<?php echo SITE; ?>','<?php echo $pages['id']; ?>',this)"><?php echo $pages['page_title']; ?></td><td<?php if($pages['type']=='0'||$pages['type']=='2') { ?>>/<?php echo $pages['id'].'-'.preg_replace('/[^a-zA-Z0-9]/','_',$pages['page_title']); } else { ?> ondblclick="cms.page.edit_link.expand('<?php echo SITE; ?>','<?php echo $pages['id']; ?>',this)"><?php echo $pages['link']; }?></td><td><?php if($pages['type']=='0'||$pages['type']=='1') { ?><a onclick="cms.page.delete('<?php echo SITE; ?>','<?php echo $pages['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete page'); ?>"></a> <?php } ?><a onclick="cms.page.edit_order.down('<?php echo SITE; ?>','<?php echo $pages['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move the page down'); ?>"></a> <a onclick="cms.page.edit_order.up('<?php echo SITE; ?>','<?php echo $pages['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move the page up'); ?>"></a> <a onclick="cms.page.visiblity.<?php if($pages['visible']){ echo "off";} else { echo "on";} ?>('<?php echo SITE; ?>','<?php echo $pages['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/lightbulb<?php if(!$pages['visible']) { echo "_off";} ?>.png" alt="<?php if($pages['visible']) { echo $t->_('Visible');} else { echo $t->_('Invisible');} ?>" title="<?php if($pages['visible']) { echo $t->_('Make page invisible');} else { echo $t->_('Make page visible');} ?>"></a></td></tr>
1133 <?php if($pages['type']=='0'||$pages['type']=='2') {
1134 $sectionsq = cms::get_sections($pages['id']);
1135 foreach ($sectionsq as $sections) {?>
1136- <tr><td>&nbsp;</td><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_black.png"></td><td ondblclick="cms.section.edit_title.expand('<?php echo $site; ?>','<?php echo $sections['id']; ?>',this)"><?php echo $sections['section_title']; ?></td><td>/<?php echo $pages['id'].'-'.preg_replace('/[^a-zA-Z0-9]/','_',$pages['page_title']).'/#'.preg_replace('/[^a-zA-Z0-9]/','_',$sections['section_title']); ?></td><td><a onclick="cms.section.delete('<?php echo $site; ?>','<?php echo $sections['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete section'); ?>"></a> <a onclick="cms.section.edit_order.down('<?php echo $site; ?>','<?php echo $sections['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move section down'); ?>"></a> <a onclick="cms.section.edit_order.up('<?php echo $site; ?>','<?php echo $sections['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move section up'); ?>"></a> <?php if($sections['plugin-reference']=='') { ?><a onclick="cms.section.open_mce('<?php echo $site; ?>','<?php echo $sections['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/pencil.png" alt="<?php echo $t->_('Edit'); ?>" title="<?php echo $t->_('Edit section content'); ?>"></a> <?php } ?><a onclick="cms.section.switch_page.expand('<?php echo $site; ?>','<?php echo $sections['id']; ?>','<?php echo $pages['id']; ?>',this)"><img src="<?php echo URL_IMG; ?>/Silk/arrow_switch.png" alt="<?php echo $t->_('Other page'); ?>" title="<?php echo $t->_('Move this section to another page'); ?>"></a></td></tr>
1137+ <tr><td>&nbsp;</td><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_black.png"></td><td ondblclick="cms.section.edit_title.expand('<?php echo SITE; ?>','<?php echo $sections['id']; ?>',this)"><?php echo $sections['section_title']; ?></td><td>/<?php echo $pages['id'].'-'.preg_replace('/[^a-zA-Z0-9]/','_',$pages['page_title']).'/#'.preg_replace('/[^a-zA-Z0-9]/','_',$sections['section_title']); ?></td><td><a onclick="cms.section.delete('<?php echo SITE; ?>','<?php echo $sections['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete section'); ?>"></a> <a onclick="cms.section.edit_order.down('<?php echo SITE; ?>','<?php echo $sections['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move section down'); ?>"></a> <a onclick="cms.section.edit_order.up('<?php echo SITE; ?>','<?php echo $sections['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move section up'); ?>"></a> <?php if($sections['plugin-reference']=='') { ?><a onclick="cms.section.open_mce('<?php echo SITE; ?>','<?php echo $sections['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/pencil.png" alt="<?php echo $t->_('Edit'); ?>" title="<?php echo $t->_('Edit section content'); ?>"></a> <?php } ?><a onclick="cms.section.switch_page.expand('<?php echo SITE; ?>','<?php echo $sections['id']; ?>','<?php echo $pages['id']; ?>',this)"><img src="<?php echo URL_IMG; ?>/Silk/arrow_switch.png" alt="<?php echo $t->_('Other page'); ?>" title="<?php echo $t->_('Move this section to another page'); ?>"></a></td></tr>
1138 <?php } ?>
1139- <tr onclick="cms.section.add('<?php echo $site; ?>',<?php echo $pages['id']; ?>)"><td>&nbsp;</td><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="3"><?php echo $t->_('Add a section to this page'); ?></td></tr>
1140+ <tr onclick="cms.section.add('<?php echo SITE; ?>',<?php echo $pages['id']; ?>)"><td>&nbsp;</td><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="3"><?php echo $t->_('Add a section to this page'); ?></td></tr>
1141 <?php } }?>
1142- <tr onclick="cms.page.add('<?php echo $site; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="4"><?php echo $t->_('Add page'); ?></td></tr>
1143- <tr onclick="cms.page.add_link('<?php echo $site; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/link_add.png" alt=""></td><td colspan="4"><?php echo $t->_('Add link'); ?></td></tr>
1144+ <tr onclick="cms.page.add('<?php echo SITE; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="4"><?php echo $t->_('Add page'); ?></td></tr>
1145+ <tr onclick="cms.page.add_link('<?php echo SITE; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/link_add.png" alt=""></td><td colspan="4"><?php echo $t->_('Add link'); ?></td></tr>
1146 </table>
1147 <ul style='display: none';>
1148 <?php $pagesq = cms::get_pages(); foreach($pagesq as $pages) { ?>
1149- <li class='ui-state-default' id='sort_<?php echo $site; ?>_cms_<?php echo $pages['id']; ?>'><?php echo $pages['page_title'];
1150+ <li class='ui-state-default' id='sort_<?php echo SITE; ?>_cms_<?php echo $pages['id']; ?>'><?php echo $pages['page_title'];
1151 if($pages['type']==0||$pages['type']==2) { ?>
1152- <ul class='sort_<?php echo $site; ?>_cms_sub sub-sortable'>
1153+ <ul class='sort_<?php echo SITE; ?>_cms_sub sub-sortable'>
1154 <?php $sectionsq=cms::get_sections($pages['id']); foreach($sectionsq as $sections) { ?>
1155- <li class='ui-state-default' id='sort_<?php echo $site; ?>_cms_sub_<?php echo $sections['id']; ?>'><?php echo $sections['section_title']; ?></li>
1156+ <li class='ui-state-default' id='sort_<?php echo SITE; ?>_cms_sub_<?php echo $sections['id']; ?>'><?php echo $sections['section_title']; ?></li>
1157 <?php } ?>
1158 <li class='gui-nosort ui-state-disabled ui-state-default'><?php echo $t->_('Add a section to this page'); ?></li>
1159 </ul>
1160@@ -44,7 +44,7 @@
1161 <li class='gui-nosort ui-state-disabled ui-state-default'><?php echo $t->_('Add page'); ?></li>
1162 <li class='gui-nosort ui-state-disabled ui-state-default'><?php echo $t->_('Add link'); ?></li>
1163 </ul>
1164- <input type='button' onclick='$(this).prevAll("table").hide("blind","slow");$(this).prev("ul").show("blind","slow").sortable({items:"li:not(.gui-nosort,li li)"});$(".sort_<?php echo $site; ?>_cms_sub").sortable({items:"li:not(.gui-nosort)",connectWith:".sort_<?php echo $site; ?>_cms_sub"});$(this).next().show("blind","slow");$(this).hide("blind","slow")' value='<?php echo $t->_('Sort'); ?>'> <input type='button' onclick='cms.sort("<?php echo $site; ?>",multiSortableToArray($(this).prevAll("ul")))' value='<?php echo $t->_('Save this order'); ?>' style='display:none'>
1165+ <input type='button' onclick='$(this).prevAll("table").hide("blind","slow");$(this).prev("ul").show("blind","slow").sortable({items:"li:not(.gui-nosort,li li)"});$(".sort_<?php echo SITE; ?>_cms_sub").sortable({items:"li:not(.gui-nosort)",connectWith:".sort_<?php echo SITE; ?>_cms_sub"});$(this).next().show("blind","slow");$(this).hide("blind","slow")' value='<?php echo $t->_('Sort'); ?>'> <input type='button' onclick='cms.sort("<?php echo SITE; ?>",multiSortableToArray($(this).prevAll("ul")))' value='<?php echo $t->_('Save this order'); ?>' style='display:none'>
1166
1167 <?php }
1168 else if($_GET['function']=="delete") {
1169@@ -59,11 +59,11 @@
1170 }
1171 else if($_GET['function']=="edit_title") {
1172 if($_GET['type']=="page") {
1173- $q= $remote_connection->query('UPDATE `'.$site.'_pageindex` SET `page_title`="'.$_GET['title'].'" WHERE `id`='.$_GET['id']);
1174+ $q= $remote_connection->query('UPDATE `'.SITE.'_pageindex` SET `page_title`="'.$_GET['title'].'" WHERE `id`='.$_GET['id']);
1175 if($q) { echo "true"; } else { echo "false"; }
1176 }
1177 else if($_GET['type']=="section") {
1178- $q= $remote_connection->query('UPDATE `'.$site.'_pages` SET `section_title`="'.$_GET['title'].'" WHERE `id`='.$_GET['id']);
1179+ $q= $remote_connection->query('UPDATE `'.SITE.'_pages` SET `section_title`="'.$_GET['title'].'" WHERE `id`='.$_GET['id']);
1180 if($q) { echo "true"; } else { echo "false"; }
1181 }
1182 }
1183@@ -86,12 +86,12 @@
1184 else {
1185 $page_length=count($_POST['order_main']);
1186 for($i=0;$i<$page_length;$i++) {
1187- $x[]=$remote_connection->query('UPDATE `'.$site.'_pageindex` SET `page_order`='.$i.' WHERE `id`='.$_POST['order_main'][$i]);
1188+ $x[]=$remote_connection->query('UPDATE `'.SITE.'_pageindex` SET `page_order`='.$i.' WHERE `id`='.$_POST['order_main'][$i]);
1189 }
1190 foreach($_POST['order_sub'] as $pageid=>$sections) {
1191 $sect_length=count($sections);
1192 for($i=0;$i<$sect_length;$i++) {
1193- $x[]=$remote_connection->query('UPDATE `'.$site.'_pages` SET `page_id`='.$pageid.', `section_order`='.$i.' WHERE `id`='.$sections[$i]);
1194+ $x[]=$remote_connection->query('UPDATE `'.SITE.'_pages` SET `page_id`='.$pageid.', `section_order`='.$i.' WHERE `id`='.$sections[$i]);
1195 }
1196 }
1197 if(!in_array(false,$x,true)) echo "true";
1198@@ -115,7 +115,7 @@
1199 }
1200 else if($_GET['function']=="switch_page") {
1201 if(isset($_GET['getpages'])) {
1202- $query=$remote_connection->query('SELECT * FROM `'.$site.'_pageindex` WHERE `type`=2 OR `type`=0');
1203+ $query=$remote_connection->query('SELECT * FROM `'.SITE.'_pageindex` WHERE `type`=2 OR `type`=0');
1204 while($pages=$query->fetch_assoc()) {
1205 if($_GET['currentpage']!=$pages['id']) {
1206 echo '<option value="'.$pages['id'].'">'.$pages['page_title'].'</option>';
1207@@ -126,7 +126,7 @@
1208 }
1209 }
1210 else {
1211- $query0=$remote_connection->query('SELECT * FROM `'.$site.'_pages` WHERE `page_id`='.$_GET['newpage'].' ORDER BY `section_order` DESC');
1212+ $query0=$remote_connection->query('SELECT * FROM `'.SITE.'_pages` WHERE `page_id`='.$_GET['newpage'].' ORDER BY `section_order` DESC');
1213 $res0=$query0->fetch_assoc();
1214 $order_last=$res0['section_order'];
1215 $new_order_last=$order_last+1;
1216@@ -181,7 +181,7 @@
1217
1218 </script>
1219 </head><body>
1220-<form action="?control=addons&site=<?php echo $site; ?>&aref=cms&function=mce&id=<?php echo $_GET['id']; ?>&save=true" method="POST">
1221+<form action="?control=addons&site=<?php echo SITE; ?>&aref=cms&function=mce&id=<?php echo $_GET['id']; ?>&save=true" method="POST">
1222 <textarea name="section_main" id="section_main" style="width: 100%; height: 100%"><?php echo $edit_data['section_main']; ?></textarea>
1223 </form>
1224 <?php }
1225\ No newline at end of file
1226
1227=== modified file 'system_remote/plugins/cms/scripts.php'
1228--- system/plugins/cms/scripts.php 2011-03-14 17:11:00 +0000
1229+++ system_remote/plugins/cms/scripts.php 2011-03-30 16:10:37 +0000
1230@@ -1,4 +1,4 @@
1231-<?php //@./system/plugins/cms/scripts.php ?>
1232+<?php //@./system_remote/plugins/cms/scripts.php ?>
1233 var cms={
1234 page: {
1235 edit_title: {
1236
1237=== modified file 'system_remote/plugins/col1/api.php'
1238--- system/plugins/col1/api.php 2011-03-29 18:57:42 +0000
1239+++ system_remote/plugins/col1/api.php 2011-03-30 16:10:37 +0000
1240@@ -1,4 +1,4 @@
1241-<?php //@./system/plugins/col1/api.php ?>
1242+<?php //@./system_remote/plugins/col1/api.php ?>
1243 <?php
1244 class col1 implements pluginSingleTable {
1245 static function gets() {
1246
1247=== modified file 'system_remote/plugins/col1/default.php'
1248--- system/plugins/col1/default.php 2011-03-14 18:28:28 +0000
1249+++ system_remote/plugins/col1/default.php 2011-03-30 16:10:37 +0000
1250@@ -1,4 +1,4 @@
1251-<?php //@./system/plugins/col1/default.php ?>
1252+<?php //@./system_remote/plugins/col1/default.php ?>
1253 <!-- HEADERS >
1254 <AJAX_SCRIPTLOC>a_col1_scripts.js</AJAX_SCRIPTLOC>
1255 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
1256@@ -11,17 +11,17 @@
1257 * COPYRIGHT 2010 remotecp.co.cc
1258 */
1259
1260- if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.$site.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1261+ if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.SITE.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1262 if(!isset($_GET['function'])) {$_GET['function']="list"; }
1263 if($_GET['function']=="list") {
1264 $query = col1::gets(); ?>
1265 <table><tr><th></th><th><?php echo $t->_('Title'); ?></th><th><?php echo $t->_('Actions'); ?></th></tr>
1266 <?php foreach($query as $section) {?>
1267- <tr id='sort_<?php echo $site; ?>_col1_<?php echo $section['id']; ?>'><td<?php if($section['plugin-reference']==NULL) { ?> ondblclick="col1.edit_rights.expand('<?php echo $site; ?>','<?php echo $section['id']; ?>',this,'<?php echo $section['access']; ?>')"><img src="<?php echo URL_IMG; ?>/Silk/bullet_<?php if($section['access']==0) { ?>green<?php } else if($section['access']==1) { ?>orange<?php } else if($section['access']==2) { ?>red<?php } ?>.png"> <?php } else { ?>><img src="<?php echo URL_IMG; ?>/Silk/bullet_black.png" alt=""><?php } ?></td><td ondblclick="col1.edit_title.expand('<?php echo $site; ?>','<?php echo $section['id']; ?>',this)"><?php echo $section['title']; ?></td><td><?php if($section['plugin-reference']==NULL) { ?><a onclick="col1.delete('<?php echo $site; ?>','<?php echo $section['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete section'); ?>"></a> <?php } ?><a onclick="col1.edit_order.down('<?php echo $site; ?>','<?php echo $section['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move section down'); ?>"></a> <a onclick="col1.edit_order.up('<?php echo $site; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move section up'); ?>"></a><?php if($section['plugin-reference']==NULL) { ?> <a onclick="col1.open_mce('<?php echo $site; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/pencil.png" alt="<?php echo $t->_('Edit'); ?>" title="<?php echo $t->_('Edit section content'); ?>"></a><?php } ?></td></tr>
1268+ <tr id='sort_<?php echo SITE; ?>_col1_<?php echo $section['id']; ?>'><td<?php if($section['plugin-reference']==NULL) { ?> ondblclick="col1.edit_rights.expand('<?php echo SITE; ?>','<?php echo $section['id']; ?>',this,'<?php echo $section['access']; ?>')"><img src="<?php echo URL_IMG; ?>/Silk/bullet_<?php if($section['access']==0) { ?>green<?php } else if($section['access']==1) { ?>orange<?php } else if($section['access']==2) { ?>red<?php } ?>.png"> <?php } else { ?>><img src="<?php echo URL_IMG; ?>/Silk/bullet_black.png" alt=""><?php } ?></td><td ondblclick="col1.edit_title.expand('<?php echo SITE; ?>','<?php echo $section['id']; ?>',this)"><?php echo $section['title']; ?></td><td><?php if($section['plugin-reference']==NULL) { ?><a onclick="col1.delete('<?php echo SITE; ?>','<?php echo $section['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete section'); ?>"></a> <?php } ?><a onclick="col1.edit_order.down('<?php echo SITE; ?>','<?php echo $section['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move section down'); ?>"></a> <a onclick="col1.edit_order.up('<?php echo SITE; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move section up'); ?>"></a><?php if($section['plugin-reference']==NULL) { ?> <a onclick="col1.open_mce('<?php echo SITE; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/pencil.png" alt="<?php echo $t->_('Edit'); ?>" title="<?php echo $t->_('Edit section content'); ?>"></a><?php } ?></td></tr>
1269 <?php } ?>
1270- <tr class='gui-nosort' onclick="col1.add('<?php echo $site; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="2"><?php echo $t->_('Add section'); ?></td></tr>
1271+ <tr class='gui-nosort' onclick="col1.add('<?php echo SITE; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="2"><?php echo $t->_('Add section'); ?></td></tr>
1272 </table>
1273- <input type='button' onclick='tableToSortable($(this).prev("table"),1,{items:"li:not(.gui-nosort)"});$(this).next().show("blind","slow");$(this).hide("blind","slow")' value='<?php echo $t->_('Sort'); ?>'> <input type='button' onclick='col1.sort("<?php echo $site; ?>",$(this).prevAll("ul").sortable("toArray"))' value='<?php echo $t->_('Save this order'); ?>' style='display:none'>
1274+ <input type='button' onclick='tableToSortable($(this).prev("table"),1,{items:"li:not(.gui-nosort)"});$(this).next().show("blind","slow");$(this).hide("blind","slow")' value='<?php echo $t->_('Sort'); ?>'> <input type='button' onclick='col1.sort("<?php echo SITE; ?>",$(this).prevAll("ul").sortable("toArray"))' value='<?php echo $t->_('Save this order'); ?>' style='display:none'>
1275 <?php }
1276 else if($_GET['function']=="delete") {
1277 if(col1::delete($_GET['id'])) echo "true";
1278@@ -40,7 +40,7 @@
1279 else {
1280 $sect_length=count($_POST['order']);
1281 for($i=0;$i<$sect_length;$i++) {
1282- $x[]=$remote_connection->query('UPDATE `'.$site.'_col1` SET `order`='.$i.' WHERE `id`='.$_POST['order'][$i]);
1283+ $x[]=$remote_connection->query('UPDATE `'.SITE.'_col1` SET `order`='.$i.' WHERE `id`='.$_POST['order'][$i]);
1284 }
1285 if(!in_array(false,$x,true)) echo "true";
1286 else echo "false";
1287@@ -52,7 +52,7 @@
1288 else echo "false";
1289 }
1290 else if($_GET['function']=="edit_rights") {
1291- $query=$remote_connection->query('UPDATE `'.$site.'_col1` SET `access`='.$_GET['rights'].' WHERE `id`='.$_GET['id']);
1292+ $query=$remote_connection->query('UPDATE `'.SITE.'_col1` SET `access`='.$_GET['rights'].' WHERE `id`='.$_GET['id']);
1293 if($query) { echo "true"; }
1294 else { echo "false"; }
1295 }
1296@@ -87,7 +87,7 @@
1297
1298 </script>
1299 </head><body>
1300-<form action="?control=addons&site=<?php echo $site; ?>&aref=col1&&function=mce&id=<?php echo $_GET['id']; ?>&save=true" method="POST">
1301+<form action="?control=addons&site=<?php echo SITE; ?>&aref=col1&&function=mce&id=<?php echo $_GET['id']; ?>&save=true" method="POST">
1302 <textarea name="section_main" `id`="section_main" style="width: 100%; height: 100%"><?php echo $edit_data['content']; ?></textarea>
1303 </form>
1304 <?php }
1305
1306=== modified file 'system_remote/plugins/col1/scripts.php'
1307--- system/plugins/col1/scripts.php 2011-03-14 16:08:20 +0000
1308+++ system_remote/plugins/col1/scripts.php 2011-03-30 16:10:37 +0000
1309@@ -1,4 +1,4 @@
1310-<?php //@./system/plugins/col1/scripts.php ?>
1311+<?php //@./system_remote/plugins/col1/scripts.php ?>
1312 var col1={
1313 edit_title: {
1314 func: function(site,id,cont){
1315
1316=== modified file 'system_remote/plugins/col3/api.php'
1317--- system/plugins/col3/api.php 2011-03-29 18:57:42 +0000
1318+++ system_remote/plugins/col3/api.php 2011-03-30 16:10:37 +0000
1319@@ -1,4 +1,4 @@
1320-<?php //@./system/plugins/col3/api.php ?>
1321+<?php //@./system_remote/plugins/col3/api.php ?>
1322 <?php
1323 class col3 implements pluginSingleTable{
1324 static function gets() {
1325
1326=== modified file 'system_remote/plugins/col3/default.php'
1327--- system/plugins/col3/default.php 2011-03-14 18:28:28 +0000
1328+++ system_remote/plugins/col3/default.php 2011-03-30 16:10:37 +0000
1329@@ -1,4 +1,4 @@
1330-<?php //@./system/plugins/col3/default.php ?>
1331+<?php //@./system_remote/plugins/col3/default.php ?>
1332 <!-- HEADERS >
1333 <AJAX_SCRIPTLOC>a_col3_scripts.js</AJAX_SCRIPTLOC>
1334 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
1335@@ -11,17 +11,17 @@
1336 * COPYRIGHT 2010 remotecp.co.cc
1337 */
1338
1339- if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.$site.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1340+ if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.SITE.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1341 if(!isset($_GET['function'])) {$_GET['function']="list"; }
1342 if($_GET['function']=="list") {
1343 $query = col3::gets(); ?>
1344 <table><tr><th></th><th><?php echo $t->_('Title'); ?></th><th><?php echo $t->_('Actions'); ?></th></tr>
1345 <?php foreach($query as $section) {?>
1346- <tr id='sort_<?php echo $site; ?>_col3_<?php echo $section['id']; ?>'><td<?php if($section['plugin-reference']==NULL) { ?> ondblclick="col3.edit_rights.expand('<?php echo $site; ?>','<?php echo $section['id']; ?>',this,'<?php echo $section['access']; ?>')"><img src="<?php echo URL_IMG; ?>/Silk/bullet_<?php if($section['access']==0) { ?>green<?php } else if($section['access']==1) { ?>orange<?php } else if($section['access']==2) { ?>red<?php } ?>.png"> <?php } else { ?>><img src="<?php echo URL_IMG; ?>/Silk/bullet_black.png" alt=""><?php } ?></td><td ondblclick="col3.edit_title.expand('<?php echo $site; ?>','<?php echo $section['id']; ?>',this)"><?php echo $section['title']; ?></td><td><?php if($section['plugin-reference']==NULL) { ?><a onclick="col3.delete('<?php echo $site; ?>','<?php echo $section['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete section'); ?>"></a> <?php } ?><a onclick="col3.edit_order.down('<?php echo $site; ?>','<?php echo $section['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move section down'); ?>"></a> <a onclick="col3.edit_order.up('<?php echo $site; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move section up'); ?>"></a><?php if($section['plugin-reference']==NULL) { ?> <a onclick="col3.open_mce('<?php echo $site; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/pencil.png" alt="<?php echo $t->_('Edit'); ?>" title="<?php echo $t->_('Edit section content'); ?>"></a><?php } ?></td></tr>
1347+ <tr id='sort_<?php echo SITE; ?>_col3_<?php echo $section['id']; ?>'><td<?php if($section['plugin-reference']==NULL) { ?> ondblclick="col3.edit_rights.expand('<?php echo SITE; ?>','<?php echo $section['id']; ?>',this,'<?php echo $section['access']; ?>')"><img src="<?php echo URL_IMG; ?>/Silk/bullet_<?php if($section['access']==0) { ?>green<?php } else if($section['access']==1) { ?>orange<?php } else if($section['access']==2) { ?>red<?php } ?>.png"> <?php } else { ?>><img src="<?php echo URL_IMG; ?>/Silk/bullet_black.png" alt=""><?php } ?></td><td ondblclick="col3.edit_title.expand('<?php echo SITE; ?>','<?php echo $section['id']; ?>',this)"><?php echo $section['title']; ?></td><td><?php if($section['plugin-reference']==NULL) { ?><a onclick="col3.delete('<?php echo SITE; ?>','<?php echo $section['id'] ?>');"><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Delete section'); ?>"></a> <?php } ?><a onclick="col3.edit_order.down('<?php echo SITE; ?>','<?php echo $section['id'];?>',this);"><img src="<?php echo URL_IMG ?>/Silk/arrow_down.png" alt="<?php echo $t->_('Down'); ?>" title="<?php echo $t->_('Move section down'); ?>"></a> <a onclick="col3.edit_order.up('<?php echo SITE; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/arrow_up.png" alt="<?php echo $t->_('Up'); ?>" title="<?php echo $t->_('Move section up'); ?>"></a><?php if($section['plugin-reference']==NULL) { ?> <a onclick="col3.open_mce('<?php echo SITE; ?>','<?php echo $section['id']; ?>');"><img src="<?php echo URL_IMG; ?>/Silk/pencil.png" alt="<?php echo $t->_('Edit'); ?>" title="<?php echo $t->_('Edit section content'); ?>"></a><?php } ?></td></tr>
1348 <?php } ?>
1349- <tr class='gui-nosort' onclick="col3.add('<?php echo $site; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="2"><?php echo $t->_('Add section'); ?></td></tr>
1350+ <tr class='gui-nosort' onclick="col3.add('<?php echo SITE; ?>')"><td><img src="<?php echo URL_IMG; ?>/Silk/bullet_add.png" alt=""></td><td colspan="2"><?php echo $t->_('Add section'); ?></td></tr>
1351 </table>
1352- <input type='button' onclick='tableToSortable($(this).prev("table"),1,{items:"li:not(.gui-nosort)"});$(this).next().show("blind","slow");$(this).hide("blind","slow")' value='<?php echo $t->_('Sort'); ?>'> <input type='button' onclick='col3.sort("<?php echo $site; ?>",$(this).prevAll("ul").sortable("toArray"))' value='<?php echo $t->_('Save this order'); ?>' style='display:none'>
1353+ <input type='button' onclick='tableToSortable($(this).prev("table"),1,{items:"li:not(.gui-nosort)"});$(this).next().show("blind","slow");$(this).hide("blind","slow")' value='<?php echo $t->_('Sort'); ?>'> <input type='button' onclick='col3.sort("<?php echo SITE; ?>",$(this).prevAll("ul").sortable("toArray"))' value='<?php echo $t->_('Save this order'); ?>' style='display:none'>
1354
1355 <?php }
1356 else if($_GET['function']=="delete") {
1357@@ -41,7 +41,7 @@
1358 else {
1359 $sect_length=count($_POST['order']);
1360 for($i=0;$i<$sect_length;$i++) {
1361- $x[]=$remote_connection->query('UPDATE `'.$site.'_col3` SET `order`='.$i.' WHERE `id`='.$_POST['order'][$i]);
1362+ $x[]=$remote_connection->query('UPDATE `'.SITE.'_col3` SET `order`='.$i.' WHERE `id`='.$_POST['order'][$i]);
1363 }
1364 if(!in_array(false,$x,true)) echo "true";
1365 else echo "false";
1366@@ -53,7 +53,7 @@
1367 else echo "false";
1368 }
1369 else if($_GET['function']=="edit_rights") {
1370- $query=$remote_connection->query('UPDATE `'.$site.'_col3` SET `access`='.$_GET['rights'].' WHERE `id`='.$_GET['id']);
1371+ $query=$remote_connection->query('UPDATE `'.SITE.'_col3` SET `access`='.$_GET['rights'].' WHERE `id`='.$_GET['id']);
1372 if($query) { echo "true"; }
1373 else { echo "false"; }
1374 }
1375@@ -88,7 +88,7 @@
1376
1377 </script>
1378 </head><body>
1379-<form action="?control=addons&site=<?php echo $site; ?>&aref=col3&&function=mce&id=<?php echo $_GET['id']; ?>&save=true" method="POST">
1380+<form action="?control=addons&site=<?php echo SITE; ?>&aref=col3&&function=mce&id=<?php echo $_GET['id']; ?>&save=true" method="POST">
1381 <textarea name="section_main" `id`="section_main" style="width: 100%; height: 100%"><?php echo $edit_data['content']; ?></textarea>
1382 </form>
1383 <?php }
1384
1385=== modified file 'system_remote/plugins/col3/scripts.php'
1386--- system/plugins/col3/scripts.php 2011-03-14 16:08:20 +0000
1387+++ system_remote/plugins/col3/scripts.php 2011-03-30 16:10:37 +0000
1388@@ -1,4 +1,4 @@
1389-<?php //@./system/plugins/col3/scripts.php ?>
1390+<?php //@./system_remote/plugins/col3/scripts.php ?>
1391 var col3={
1392 edit_title: {
1393 func: function(site,id,cont){
1394
1395=== modified file 'system_remote/plugins/default.php'
1396--- system/plugins/default.php 2011-03-12 20:51:51 +0000
1397+++ system_remote/plugins/default.php 2011-03-30 16:10:37 +0000
1398@@ -1,4 +1,4 @@
1399-<?php //@./system/plugins/default.php ?>
1400+<?php //@./system_remote/plugins/default.php ?>
1401 <!-- HEADERS >
1402 <AJAX_SCRIPTLOC>a__scripts.js</AJAX_SCRIPTLOC>
1403 <AJAX_SCRIPTEVAL>NULL</AJAX_SCRIPTEVAL>
1404@@ -7,16 +7,16 @@
1405 if($_GET['function']=='install') {
1406 if(!addons::available($_GET['a'])) echo "false";
1407 else {
1408- $remote_connection->query('UPDATE `'.$site.'_addons` SET `status`=1 WHERE `reference`="'.$_GET['a'].'"');
1409- if(!require_once('system/plugins/'.$_GET['a'].'/install.php')) { echo "false"; $remote_connection->query('UPDATE `'.$site.'_addons` SET `status`=0 WHERE `reference`="'.$_GET['install'].'"'); exit;}
1410+ $remote_connection->query('UPDATE `'.SITE.'_addons` SET `status`=1 WHERE `reference`="'.$_GET['a'].'"');
1411+ if(!require_once('system_remote/plugins/'.$_GET['a'].'/install.php')) { echo "false"; $remote_connection->query('UPDATE `'.SITE.'_addons` SET `status`=0 WHERE `reference`="'.$_GET['install'].'"'); exit;}
1412 echo "true";
1413 }
1414 }
1415 else if($_GET['function']=='uninstall') {
1416 if(!addons::available($_GET['a'])) echo "false";
1417 else {
1418- $remote_connection->query('UPDATE `'.$site.'_addons` SET `status`=0 WHERE `reference`="'.$_GET['a'].'"');
1419- if(!require_once('system/plugins/'.$_GET['a'].'/uninstall.php')) { echo "false"; $remote_connection->query('UPDATE `'.$site.'_addons` SET `status`=1 WHERE `reference`="'.$_GET['uninstall'].'"'); exit;}
1420+ $remote_connection->query('UPDATE `'.SITE.'_addons` SET `status`=0 WHERE `reference`="'.$_GET['a'].'"');
1421+ if(!require_once('system_remote/plugins/'.$_GET['a'].'/uninstall.php')) { echo "false"; $remote_connection->query('UPDATE `'.SITE.'_addons` SET `status`=1 WHERE `reference`="'.$_GET['uninstall'].'"'); exit;}
1422 echo "true";
1423 }
1424 }
1425@@ -38,7 +38,7 @@
1426 }
1427 }
1428 else if($_GET['function']=='editlvl') {
1429- if($remote_connection->query('UPDATE `sites` SET `userlevel`='.$_GET['lvl'].' WHERE `username`=\''.$_GET['user'].'\' AND `ref`=\''.$site.'\'')) {
1430+ if($remote_connection->query('UPDATE `sites` SET `userlevel`='.$_GET['lvl'].' WHERE `username`=\''.$_GET['user'].'\' AND `ref`=\''.SITE.'\'')) {
1431 echo "true";
1432 }
1433 else {
1434@@ -49,7 +49,7 @@
1435 echo "<option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9 (SU)</option>";
1436 }
1437 else if($_GET['function']=='edittitle') {
1438- if($remote_connection->query('UPDATE `sites` SET `title`=\''.$_GET['title'].'\' WHERE `username`=\''.$_GET['user'].'\' AND `ref`=\''.$site.'\'')) {
1439+ if($remote_connection->query('UPDATE `sites` SET `title`=\''.$_GET['title'].'\' WHERE `username`=\''.$_GET['user'].'\' AND `ref`=\''.SITE.'\'')) {
1440 echo "true";
1441 }
1442 else {
1443@@ -57,7 +57,7 @@
1444 }
1445 }
1446 else if($_GET['function']=='deleteuser') {
1447- if($remote_connection->query('DELETE FROM `sites` WHERE `username`=\''.$_POST['username'].'\' AND `ref`=\''.$site.'\'')) {
1448+ if($remote_connection->query('DELETE FROM `sites` WHERE `username`=\''.$_POST['username'].'\' AND `ref`=\''.SITE.'\'')) {
1449 echo "true";
1450 }
1451 else {
1452@@ -69,7 +69,7 @@
1453 echo "false";
1454 exit;
1455 }
1456- if($remote_connection->query('INSERT INTO `sites` VALUES(\''.$_POST['username'].'\',\''.$site.'\',\'\',0)')) {
1457+ if($remote_connection->query('INSERT INTO `sites` VALUES(\''.$_POST['username'].'\',\''.SITE.'\',\'\',0)')) {
1458 echo "true";
1459 }
1460 else {
1461@@ -79,19 +79,19 @@
1462 else if($_GET['function']=='settings') {
1463 if(isset($_POST['submit'])) {
1464 $x=array();
1465- $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['title']).'\' WHERE `site_ref`=\''.$site.'\' AND `constant_name`=\'SITE_TITLE\'');
1466- $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['slogan']).'\' WHERE `site_ref`=\''.$site.'\' AND `constant_name`=\'SITE_SLOGAN\'');
1467- $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['style']).'\' WHERE `site_ref`=\''.$site.'\' AND `constant_name`=\'SITE_CSS\'');
1468- $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['author']).'\' WHERE `site_ref`=\''.$site.'\' AND `constant_name`=\'SITE_AUTHOR\'');
1469+ $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['title']).'\' WHERE `site_ref`=\''.SITE.'\' AND `constant_name`=\'SITE_TITLE\'');
1470+ $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['slogan']).'\' WHERE `site_ref`=\''.SITE.'\' AND `constant_name`=\'SITE_SLOGAN\'');
1471+ $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['style']).'\' WHERE `site_ref`=\''.SITE.'\' AND `constant_name`=\'SITE_CSS\'');
1472+ $x[]=$remote_connection->query('UPDATE `system_siteinfo` SET `constant_value`=\''.htmlspecialchars($_POST['author']).'\' WHERE `site_ref`=\''.SITE.'\' AND `constant_name`=\'SITE_AUTHOR\'');
1473 if(!in_array(false,$x,true)) echo "true";
1474 else echo "false";
1475 }
1476 else {
1477- $settingsq=$remote_connection->query('SELECT * FROM `system_siteinfo` WHERE `site_ref`=\''.$site.'\'');
1478+ $settingsq=$remote_connection->query('SELECT * FROM `system_siteinfo` WHERE `site_ref`=\''.SITE.'\'');
1479 while($setting=$settingsq->fetch_assoc()){
1480 $settings[$setting['constant_name']]=$setting['constant_value'];
1481 }
1482- echo "<form onsubmit='addons.site.settings(\"".$site."\", this); return false;' method='POST'>
1483+ echo "<form onsubmit='addons.site.settings(\"".SITE."\", this); return false;' method='POST'>
1484 <label>".$t->_('Site title').": <input name='title' value='".$settings['SITE_TITLE']."'></label><br>
1485 <label>".$t->_('Site tagline').": <input name='slogan' value='".$settings['SITE_SLOGAN']."'></label><br>
1486 <label>".$t->_('Style').": <select name='style'>";
1487@@ -110,13 +110,13 @@
1488 }
1489 else if($_GET['function']=="deletesite") {
1490 $x=array();
1491- $tables=$remote_connection->query("SHOW TABLES LIKE '{$site}_%'");
1492+ $tables=$remote_connection->query("SHOW TABLES LIKE '{SITE}_%'");
1493 while($table=$tables->fetch_array()) {
1494 $x[]=$remote_connection->query("DROP TABLE `$table[0]`");
1495 }
1496- $x[]=$remote_connection->query("DELETE FROM `system_domains` WHERE `site`='{$site}'");
1497- $x[]=$remote_connection->query("DELETE FROM `system_siteinfo` WHERE `site_ref`='{$site}'");
1498- $x[]=$remote_connection->query("DELETE FROM `sites` WHERE `ref`='{$site}'");
1499+ $x[]=$remote_connection->query("DELETE FROM `system_domains` WHERE `site`='{SITE}'");
1500+ $x[]=$remote_connection->query("DELETE FROM `system_siteinfo` WHERE `site_ref`='{SITE}'");
1501+ $x[]=$remote_connection->query("DELETE FROM `sites` WHERE `ref`='{SITE}'");
1502 if(!in_array(false,$x)) {
1503 echo "true";
1504 }
1505@@ -127,33 +127,33 @@
1506 }
1507 exit;
1508 }
1509-$q=$remote_connection->query('SELECT * FROM `'.$site.'_addons` WHERE `status`=1 AND `ulevel`<='.$userlevel);
1510+$q=$remote_connection->query('SELECT * FROM `'.SITE.'_addons` WHERE `status`=1 AND `ulevel`<='.$userlevel);
1511 while($addons=$q->fetch_assoc()) { ?>
1512- <?php if(addons::available($addons['reference'])) { ?><img src='<?php echo URL_IMG; ?>/Silk/plugin.png' alt=''><a onclick="openLoc('<?php echo getSiteInfo($site,'SITE_TITLE'); ?> - <?php echo $addons['name']; ?>','?control=addons&site=<?php echo $site; ?>&aref=<?php echo $addons['reference']; ?>','<?php echo $site;?>_ctrls_<?php echo $addons['reference']; ?>')" ><?php echo $addons['name']; ?></a><?php } else { ?><img src='<?php echo URL_IMG; ?>/Silk/plugin_disabled.png' alt='[!]' title='<?php echo $t->_('Addon not available'); ?>'><?php echo $addons['name']; } ?><br>
1513+ <?php if(addons::available($addons['reference'])) { ?><img src='<?php echo URL_IMG; ?>/Silk/plugin.png' alt=''><a onclick="openLoc('<?php echo getSiteInfo(SITE,'SITE_TITLE'); ?> - <?php echo $addons['name']; ?>','?control=addons&site=<?php echo SITE; ?>&aref=<?php echo $addons['reference']; ?>','<?php echo SITE;?>_ctrls_<?php echo $addons['reference']; ?>')" ><?php echo $addons['name']; ?></a><?php } else { ?><img src='<?php echo URL_IMG; ?>/Silk/plugin_disabled.png' alt='[!]' title='<?php echo $t->_('Addon not available'); ?>'><?php echo $addons['name']; } ?><br>
1514 <?php }
1515 if($q->num_rows==0) {
1516 echo $t->_('You are not allowed to change anything to this site'); //Nothign under the userlevel
1517 }
1518 if($userlevel==9) {
1519-$q=$remote_connection->query('SELECT * FROM `'.$site.'_addons` WHERE `editable`=1'); ?>
1520+$q=$remote_connection->query('SELECT * FROM `'.SITE.'_addons` WHERE `editable`=1'); ?>
1521 <table><tr><th><?php $t->_('Name'); ?></th><th><?php $t->_('Actions'); ?></th></tr>
1522 <?php while($addons=$q->fetch_assoc()) {
1523 if(!addons::installable($addons['reference'])) { ?>
1524 <tr><td><img src='<?php echo URL_IMG; ?>/Silk/plugin_disabled.png' alt='[!]' title='<?php echo $t->_('Addon not available'); ?>'><?php echo $addons['name']; ?></td><td><img src="<?php echo URL_IMG ?>/Silk/script_error.png"> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"></td></tr>
1525 <?php } else { ?>
1526- <tr><td><img src='<?php echo URL_IMG; ?>/Silk/plugin.png' alt='[OK]' title='<?php echo $t->_('Addon available'); ?>'><?php echo $addons['name']; ?></td><td><?php if($addons['status']==0) {?><a onclick="addons.addons.install('<?php echo $site; ?>','<?php echo $addons['reference']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/script_add.png" alt="<?php echo $t->_('On'); ?>" title="<?php echo $t->_('Turn addon on'); ?>"></a><?php } else { ?><a onclick="addons.addons.uninstall('<?php echo $site; ?>','<?php echo $addons['reference']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/script_delete.png" alt="<?php echo $t->_('Off'); ?>" title="<?php echo $t->_('Turn addon off'); ?>"></a><?php } if(addons::installed($addons['reference'])) { ?> <a onclick="addons.addons.addto('<?php echo $site; ?>','<?php echo $addons['reference']; ?>','col1');"><img src="<?php echo URL_IMG ?>/Silk/layout_sidebar.png" alt="<?php echo $t->_('Add to column 1'); ?>" title="<?php echo $t->_('Add to column 1'); ?>"></a> <a onclick="addons.addons.addto('<?php echo $site; ?>','<?php echo $addons['reference']; ?>','col3');"><img src="<?php echo URL_IMG ?>/Silk/layout_sidebar.png" alt="<?php echo $t->_('Add to column 3'); ?>" title="<?php echo $t->_('Add to column 3'); ?>"></a> <a onclick="addons.addons.addto('<?php echo $site; ?>','<?php echo $addons['reference']; ?>','cms');"><img src="<?php echo URL_IMG ?>/Silk/layout_content.png" alt="<?php echo $t->_('Add to CMS'); ?>" title="<?php echo $t->_('Add to CMS'); ?>"></a><?php } else { ?> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <?php } ?></td></tr>
1527+ <tr><td><img src='<?php echo URL_IMG; ?>/Silk/plugin.png' alt='[OK]' title='<?php echo $t->_('Addon available'); ?>'><?php echo $addons['name']; ?></td><td><?php if($addons['status']==0) {?><a onclick="addons.addons.install('<?php echo SITE; ?>','<?php echo $addons['reference']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/script_add.png" alt="<?php echo $t->_('On'); ?>" title="<?php echo $t->_('Turn addon on'); ?>"></a><?php } else { ?><a onclick="addons.addons.uninstall('<?php echo SITE; ?>','<?php echo $addons['reference']; ?>');"><img src="<?php echo URL_IMG ?>/Silk/script_delete.png" alt="<?php echo $t->_('Off'); ?>" title="<?php echo $t->_('Turn addon off'); ?>"></a><?php } if(addons::installed($addons['reference'])) { ?> <a onclick="addons.addons.addto('<?php echo SITE; ?>','<?php echo $addons['reference']; ?>','col1');"><img src="<?php echo URL_IMG ?>/Silk/layout_sidebar.png" alt="<?php echo $t->_('Add to column 1'); ?>" title="<?php echo $t->_('Add to column 1'); ?>"></a> <a onclick="addons.addons.addto('<?php echo SITE; ?>','<?php echo $addons['reference']; ?>','col3');"><img src="<?php echo URL_IMG ?>/Silk/layout_sidebar.png" alt="<?php echo $t->_('Add to column 3'); ?>" title="<?php echo $t->_('Add to column 3'); ?>"></a> <a onclick="addons.addons.addto('<?php echo SITE; ?>','<?php echo $addons['reference']; ?>','cms');"><img src="<?php echo URL_IMG ?>/Silk/layout_content.png" alt="<?php echo $t->_('Add to CMS'); ?>" title="<?php echo $t->_('Add to CMS'); ?>"></a><?php } else { ?> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <img src="<?php echo URL_IMG ?>/Silk/layout_error.png"> <?php } ?></td></tr>
1528 <?php }} ?>
1529 </table>
1530 <?php
1531
1532-$q=$remote_connection->query('SELECT * FROM `sites` WHERE `ref`="'.$site.'"') ?>
1533+$q=$remote_connection->query('SELECT * FROM `sites` WHERE `ref`="'.SITE.'"') ?>
1534 <table><tr><th><?php echo $t->_('User'); ?></th><th><?php echo $t->_('Lv.'); ?></th><th><?php echo $t->_('Title'); ?></th><th><?php echo $t->_('Delete'); ?></th></tr>
1535 <?php while($users=$q->fetch_assoc()) { ?>
1536- <tr><td><img src="<?php echo URL_IMG; ?>/Silk/user.png"> <?php echo $users['username']; ?></td><td<?php if($users['username']!=$session->username) {?> ondblclick='addons.user.editlvl.expand("<?php echo $site; ?>","<?php echo $users['username']; ?>",this)'<?php } ?>><?php echo $users['userlevel'] ?></td><td ondblclick='addons.user.edittitle.expand("<?php echo $site;?>","<?php echo $users['username']; ?>",this)'><?php echo $users['title']; ?></td><td><?php if($users['username']!=$session->username) {?><a onclick='addons.user.delete("<?php echo $site; ?>","<?php echo $users['username']; ?>")'><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Revoke user privileges'); ?>"></a><?php } ?></td></tr>
1537+ <tr><td><img src="<?php echo URL_IMG; ?>/Silk/user.png"> <?php echo $users['username']; ?></td><td<?php if($users['username']!=$session->username) {?> ondblclick='addons.user.editlvl.expand("<?php echo SITE; ?>","<?php echo $users['username']; ?>",this)'<?php } ?>><?php echo $users['userlevel'] ?></td><td ondblclick='addons.user.edittitle.expand("<?php echo SITE;?>","<?php echo $users['username']; ?>",this)'><?php echo $users['title']; ?></td><td><?php if($users['username']!=$session->username) {?><a onclick='addons.user.delete("<?php echo SITE; ?>","<?php echo $users['username']; ?>")'><img src="<?php echo URL_IMG; ?>/Silk/delete.png" alt="<?php echo $t->_('Delete'); ?>" title="<?php echo $t->_('Revoke user privileges'); ?>"></a><?php } ?></td></tr>
1538 <?php } ?>
1539-<tr><td colspan='3'><img src="<?php echo URL_IMG; ?>/Silk/user_add.png" alt="+" title="<?php echo $t->_('Add user'); ?>"> <input type='text' onclick='openusers(this)'></td><td><a onclick='addons.user.add("<?php echo $site; ?>",this);'><img src="<?php echo URL_IMG; ?>/Silk/add.png" alt="<?php echo $t->_('Add'); ?>" title="<?php echo $t->_('Add new user'); ?>"></a></td></tr>
1540+<tr><td colspan='3'><img src="<?php echo URL_IMG; ?>/Silk/user_add.png" alt="+" title="<?php echo $t->_('Add user'); ?>"> <input type='text' onclick='openusers(this)'></td><td><a onclick='addons.user.add("<?php echo SITE; ?>",this);'><img src="<?php echo URL_IMG; ?>/Silk/add.png" alt="<?php echo $t->_('Add'); ?>" title="<?php echo $t->_('Add new user'); ?>"></a></td></tr>
1541 </table>
1542
1543-<img src="<?php echo URL_IMG; ?>/Silk/layout_edit.png" alt="<?php echo $t->_('Edit site settings'); ?>" title="<?php echo $t->_('Edit the base settings of the site'); ?>"> <a onclick="openLoc('<?php echo getSiteInfo($site,'SITE_TITLE'); ?> - <?php echo $t->_('Settings'); ?>','?control=addons&site=<?php echo $site; ?>&function=settings','<?php echo $site;?>_settings')"><?php echo $t->_('Edit site settings'); ?></a><br>
1544-<img src="<?php echo URL_IMG; ?>/Silk/layout_delete.png" alt="<?php echo $t->_('Delete site'); ?>" title="<?php echo $t->_('Delete all site content and the site itself'); ?>"> <a onclick='addons.site.delete("<?php echo $site; ?>");'><?php echo $t->_('Delete site'); ?></a>
1545+<img src="<?php echo URL_IMG; ?>/Silk/layout_edit.png" alt="<?php echo $t->_('Edit site settings'); ?>" title="<?php echo $t->_('Edit the base settings of the site'); ?>"> <a onclick="openLoc('<?php echo getSiteInfo(SITE,'SITE_TITLE'); ?> - <?php echo $t->_('Settings'); ?>','?control=addons&site=<?php echo SITE; ?>&function=settings','<?php echo SITE;?>_settings')"><?php echo $t->_('Edit site settings'); ?></a><br>
1546+<img src="<?php echo URL_IMG; ?>/Silk/layout_delete.png" alt="<?php echo $t->_('Delete site'); ?>" title="<?php echo $t->_('Delete all site content and the site itself'); ?>"> <a onclick='addons.site.delete("<?php echo SITE; ?>");'><?php echo $t->_('Delete site'); ?></a>
1547 <?php } ?>
1548\ No newline at end of file
1549
1550=== modified file 'system_remote/plugins/filemanager/default.php'
1551--- system/plugins/filemanager/default.php 2011-03-12 12:53:09 +0000
1552+++ system_remote/plugins/filemanager/default.php 2011-03-30 16:10:37 +0000
1553@@ -1,4 +1,4 @@
1554-<?php //@./system/plugins/filemanager/default.php ?>
1555+<?php //@./system_remote/plugins/filemanager/default.php ?>
1556 <?php
1557 /**
1558 * system/plugins/filemanager.php - RemoteCP (?control=addons&aref=filemanager)
1559@@ -17,10 +17,10 @@
1560 < HEADERS -->$buffer";
1561 }
1562 ob_start();
1563- if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.$site.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1564-$session->log('200','File access granted ('.$site.')');
1565+ if(!hasSiteAddonLevel()) {$session->log('403','Site access denied ('.SITE.')'); exit;} //Kill & log non-siteadmins (ze zouden hier nooit mogen geweest zijn :)
1566+$session->log('200','File access granted ('.SITE.')');
1567 require_once('inc/mysqlfs/mysqlfs.php');
1568-$mysqlfs=new mysqlfs($remote_connection,$site.'_fs');
1569+$mysqlfs=new mysqlfs($remote_connection,SITE.'_fs');
1570 $mysqlfs->setuser($session->username,$userlevel);
1571 function check_user($user) {
1572 global $database;
1573@@ -95,9 +95,9 @@
1574 term();return;
1575 }
1576 echo "
1577- <form action='?control=addons&site={$site}&aref=filemanager&action=edit&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='return false;'>
1578+ <form action='?control=addons&site=".SITE."&aref=filemanager&action=edit&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='return false;'>
1579 <textarea name='content' style='width: 100%;height: 90%'>".htmlentities($mysqlfs->file_get_contents($_GET['path']))."</textarea>
1580- <input type='submit' style='width: 50%;height: 10%' onclick='filemanager.edit(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;' value='".$t->_('Save')."'><input type='submit' style='width: 50%;height: 10%' name='abort' value='".$t->_('Back')."' onclick='filemanager.edit_abort(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\")'>
1581+ <input type='submit' style='width: 50%;height: 10%' onclick='filemanager.edit(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;' value='".$t->_('Save')."'><input type='submit' style='width: 50%;height: 10%' name='abort' value='".$t->_('Back')."' onclick='filemanager.edit_abort(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\")'>
1582 </form>
1583 ";
1584 $show_dir=false;
1585@@ -126,7 +126,7 @@
1586 }
1587 else {
1588 echo "
1589- <form action='?control=addons&site={$site}&aref=filemanager&action=chmod&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.chmod(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1590+ <form action='?control=addons&site=".SITE."&aref=filemanager&action=chmod&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.chmod(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1591 <div>
1592 <table>
1593 <thead><tr><th></th><th>".$t->_('Read')."</th><th>".$t->_('Write')."</th><th>".$t->_('Execute')."</th></tr></thead>
1594@@ -181,7 +181,7 @@
1595 }
1596 else {
1597 echo "
1598- <form action='?control=addons&site={$site}&aref=filemanager&action=chown&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.chown(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1599+ <form action='?control=addons&site=".SITE."&aref=filemanager&action=chown&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.chown(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1600 <input type='text' value='{$mysqlfs->getinfo($_GET['path'],'owner')}' name='user'>
1601 <input type='submit' value='".$t->_('Chown')."'>
1602 </form>
1603@@ -202,7 +202,7 @@
1604 }
1605 else {
1606 echo "
1607- <form action='?control=addons&site={$site}&aref=filemanager&action=chgrp&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.chgrp(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1608+ <form action='?control=addons&site=".SITE."&aref=filemanager&action=chgrp&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.chgrp(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1609 <input type='text' value='{$mysqlfs->getinfo($_GET['path'],'group')}' name='grp'>
1610 <input type='submit' value='".$t->_('Chgrp')."'>
1611 </form>
1612@@ -212,7 +212,7 @@
1613 $show_dir=true;
1614 }
1615 else if($_GET['action']=="upload") {
1616- echo "<form action='?control=addons&site={$site}&aref=filemanager&action=upload&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' enctype='multipart/form-data'>
1617+ echo "<form action='?control=addons&site=".SITE."&aref=filemanager&action=upload&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' enctype='multipart/form-data'>
1618 <input type='file' name='file'>
1619 <input type='submit' value='".$t->_('Upload')."'>
1620 </form>";
1621@@ -250,7 +250,7 @@
1622 }
1623 else {
1624 echo "
1625- <form action='?control=addons&site={$site}&aref=filemanager&action=rename&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.rename(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1626+ <form action='?control=addons&site=".SITE."&aref=filemanager&action=rename&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.rename(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1627 <input type='text' value='{$_GET['path']}' name='newname'>
1628 <input type='submit' value='".$t->_('Rename')."'>
1629 </form>
1630@@ -271,7 +271,7 @@
1631 }
1632 else {
1633 echo "
1634- <form action='?control=addons&site={$site}&aref=filemanager&action=copy&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.copy(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1635+ <form action='?control=addons&site=".SITE."&aref=filemanager&action=copy&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' onsubmit='filemanager.copy(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this); return false;'>
1636 <input type='text' value='{$_GET['path']}' name='dest'>
1637 <input type='submit' value='".$t->_('Copy')."'>
1638 </form>
1639@@ -304,7 +304,7 @@
1640 }
1641 #ob_start();
1642 if($show_file) {
1643- $seval="window.open('?control=addons&site=$site&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=view')";
1644+ $seval="window.open('?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=view')";
1645 $show_dir=true;
1646 $_GET['path']=dirname($_GET['path']);
1647 }
1648@@ -312,7 +312,7 @@
1649 $dir=$mysqlfs->readdir_full($_GET['path']);
1650 echo "<h1>".$t->_('Index of')." /{$mysqlfs->simplify_path($_GET['path'])}</h1>";
1651 echo "
1652- <form action='?' method='GET' onsubmit='filemanager.new(\"$site\",this); return false;'>
1653+ <form action='?' method='GET' onsubmit='filemanager.new(\"".SITE."\",this); return false;'>
1654 <input type='hidden' name='path' value='{$mysqlfs->simplify_path($_GET['path'])}'>
1655 <select name='type'>
1656 <option value='d'>".$t->_('Folder')."</option>
1657@@ -321,19 +321,19 @@
1658 <input type='text' name='name' value=''>
1659 <input type='submit' value='".$t->_('Create')."'>
1660 </form>
1661- <input type='button' value='".$t->_('Upload')."' onclick='filemanager.upload.screen(\"$site\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this)'> ";
1662+ <input type='button' value='".$t->_('Upload')."' onclick='filemanager.upload.screen(\"".SITE."\",\"{$mysqlfs->simplify_path($_GET['path'])}\",this)'> ";
1663 // echo "
1664- // <form action='?control=addons&site={$site}&aref=filemanager&action=upload&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' enctype='multipart/form-data' target='{$site}_ajax_upl_ifrm'>
1665+ // <form action='?control=addons&site=".SITE."&aref=filemanager&action=upload&path={$mysqlfs->simplify_path($_GET['path'])}' method='POST' enctype='multipart/form-data' target='".SITE."_ajax_upl_ifrm'>
1666 // <input type='file' name='file'>
1667 // <input type='submit' value='".$t->_('Upload')."' onclick='filemanager.upload.start(this)'>
1668 // </form>
1669- // <iframe name='{$site}_ajax_upl_ifrm' style='display: none'></iframe>
1670+ // <iframe name='".SITE."_ajax_upl_ifrm' style='display: none'></iframe>
1671 // ";
1672 echo "<table><thead><tr><th>".$t->_('Name')."</th><th>".$t->_('Rights')."</th><th>".$t->_('Owner')."</th><th>".$t->_('Group')."</th><th>".$t->_('Last edited')."</th><th>".$t->_('Size')."</th><th>".$t->_('Actions')."</th></tr><tr><th colspan='7'><hr></th></tr></thead><tbody>";
1673 foreach($dir as $value) {
1674 $value['time']=date('Y-m-d H:i:s',$value['time']);
1675- echo "<tr><td>[{$value['type']}] <a onclick=\"".(($value['type']=="d")?"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}','{$site}_ctrls_filemanager')":"window.open('?control=addons&site=$site&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=view'); return false;")."\">{$value['filename']}</a></td><td>{$value['rights']}</td><td>{$value['owner']}</td><td>{$value['group']}</td><td>{$value['time']}</td><td>{$mysqlfs->sizetohuman($value['size'])}</td><td>
1676- <a onclick=\"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=delete','{$site}_ctrls_filemanager')\">".$t->_('Delete')."</a>".(($value['type']=='f')?" <a onclick=\"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=edit','{$site}_ctrls_filemanager')\">".$t->_('Edit')."</a>":"")." <a onclick=\"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=chmod','{$site}_ctrls_filemanager')\">".$t->_('Chmod')."</a> <a onclick=\"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=chown','{$site}_ctrls_filemanager')\">".$t->_('Chown')."</a> <a onclick=\"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=chgrp','{$site}_ctrls_filemanager')\">".$t->_('Chgrp')."</a> <a onclick=\"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=rename','{$site}_ctrls_filemanager')\">".$t->_('Rename')."</a> <a onclick=\"openLoc('','?control=addons&site={$site}&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=copy','{$site}_ctrls_filemanager')\">".$t->_('Copy')."</a></td></tr>";
1677+ echo "<tr><td>[{$value['type']}] <a onclick=\"".(($value['type']=="d")?"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}','".SITE."_ctrls_filemanager')":"window.open('?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=view'); return false;")."\">{$value['filename']}</a></td><td>{$value['rights']}</td><td>{$value['owner']}</td><td>{$value['group']}</td><td>{$value['time']}</td><td>{$mysqlfs->sizetohuman($value['size'])}</td><td>
1678+ <a onclick=\"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=delete','".SITE."_ctrls_filemanager')\">".$t->_('Delete')."</a>".(($value['type']=='f')?" <a onclick=\"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=edit','".SITE."_ctrls_filemanager')\">".$t->_('Edit')."</a>":"")." <a onclick=\"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=chmod','".SITE."_ctrls_filemanager')\">".$t->_('Chmod')."</a> <a onclick=\"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=chown','".SITE."_ctrls_filemanager')\">".$t->_('Chown')."</a> <a onclick=\"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=chgrp','".SITE."_ctrls_filemanager')\">".$t->_('Chgrp')."</a> <a onclick=\"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=rename','".SITE."_ctrls_filemanager')\">".$t->_('Rename')."</a> <a onclick=\"openLoc('','?control=addons&site=".SITE."&aref=filemanager&path={$mysqlfs->simplify_path($_GET['path'])}/{$value['filename']}&action=copy','".SITE."_ctrls_filemanager')\">".$t->_('Copy')."</a></td></tr>";
1679 }
1680 echo "</tbody></table>";
1681 }
1682
1683=== modified file 'system_remote/plugins/filemanager/scripts.php'
1684--- system/plugins/filemanager/scripts.php 2011-02-23 18:45:08 +0000
1685+++ system_remote/plugins/filemanager/scripts.php 2011-03-30 16:10:37 +0000
1686@@ -1,4 +1,4 @@
1687-<?php //@./system/plugins/filemanager/scripts.php ?>
1688+<?php //@./system_remote/plugins/filemanager/scripts.php ?>
1689 $.getScript(URL_SCRIPTS+'/../php.js/dirname.js'); //Get dirname util
1690 filemanager={
1691 new:function(site,elem) {
1692
1693=== modified file 'system_remote/plugins/init.php'
1694--- system/plugins/init.php 2011-03-29 18:57:42 +0000
1695+++ system_remote/plugins/init.php 2011-03-30 16:10:37 +0000
1696@@ -1,3 +1,3 @@
1697-<?php //@./system/plugins/init.php ?>
1698-<?php
1699require_once('system/plugins/api.php');
1700-require_once('system/plugins/interfaces.php'); //Load all interfaces
1701$dh=opendir('system/plugins');
1702$PLUGINS=array();
1703while($file=readdir($dh)) {
1704 if($file=='..') continue;
1705 if(is_dir('system/plugins/'.$file))
1706 $PLUGINS[]=$file;
1707}
1708foreach($PLUGINS as $plugin) {
1709 if(addons::installed($plugin)&&file_exists('system/plugins/'.$plugin.'/api.php'))
1710 require_once('system/plugins/'.$plugin.'/api.php');
1711}
1712\ No newline at end of file
1713+<?php //@./system_remote/plugins/init.php ?>
1714+<?php
1715require_once('system_remote/plugins/api.php');
1716+require_once('system_remote/plugins/interfaces.php'); //Load all interfaces
1717$dh=opendir('system_remote/plugins');
1718$PLUGINS=array();
1719while($file=readdir($dh)) {
1720 if($file=='..') continue;
1721 if(is_dir('system_remote/plugins/'.$file))
1722 $PLUGINS[]=$file;
1723}
1724foreach($PLUGINS as $plugin) {
1725 if(addons::installed($plugin)&&file_exists('system_remote/plugins/'.$plugin.'/api.php'))
1726 require_once('system_remote/plugins/'.$plugin.'/api.php');
1727}
1728\ No newline at end of file
1729
1730=== modified file 'system_remote/plugins/interfaces.php'
1731--- system/plugins/interfaces.php 2011-03-29 18:49:17 +0000
1732+++ system_remote/plugins/interfaces.php 2011-03-30 16:10:37 +0000
1733@@ -1,4 +1,4 @@
1734-<?php
1735+<?php //@./system_remote/plugins/interfaces.php ?><?php
1736 /**
1737 * This file defines interfaces for all plugins
1738 * @package remotecp-panel
1739
1740=== modified file 'system_remote/plugins/scripts.php'
1741--- system/plugins/scripts.php 2011-03-12 20:51:51 +0000
1742+++ system_remote/plugins/scripts.php 2011-03-30 16:10:37 +0000
1743@@ -1,4 +1,4 @@
1744-<?php //@./system/plugins/scripts.php ?>
1745+<?php //@./system_remote/plugins/scripts.php ?>
1746 var addons= {
1747 addons: {
1748 install: function(site,ref) {

Subscribers

People subscribed via source and target branches

to all changes: