vogelor
2010-05-26 24f38b424a3d12c7f4fac1829c83725b200b1e97
Enhancement of the Website-List. The user can only select the server as filter, he has some sites at (and not ALL Servers of the server-farm)
3 files modified
15 ■■■■■ changed files
interface/lib/classes/listform.inc.php 2 ●●●●● patch | view | raw | blame | history
interface/lib/classes/tform.inc.php 11 ●●●●● patch | view | raw | blame | history
interface/web/sites/list/web_domain.list.php 2 ●●● patch | view | raw | blame | history
interface/lib/classes/listform.inc.php
@@ -91,6 +91,8 @@
            //$querystring = str_replace("{RECORDID}",$record[$table_idx],$querystring);
            $app->uses('tform');
            $querystring = str_replace("{AUTHSQL}",$app->tform->getAuthSQL('r'),$querystring);
            $querystring = str_replace("{AUTHSQL-A}",$app->tform->getAuthSQL('r','a'),$querystring);
            $querystring = str_replace("{AUTHSQL-B}",$app->tform->getAuthSQL('r','b'),$querystring);
            //* Getting the records
            $tmp_records = $app->db->queryAllRecords($querystring);
interface/lib/classes/tform.inc.php
@@ -1125,15 +1125,18 @@
        }
        function getAuthSQL($perm) {
        function getAuthSQL($perm, $table = '') {
                if($_SESSION["s"]["user"]["typ"] == 'admin') {
                    return '1';
                } else {
                    if ($table != ''){
                        $table = ' ' . $table . '.';
                    }
                    $groups = ( $_SESSION["s"]["user"]["groups"] ) ? $_SESSION["s"]["user"]["groups"] : 0;
                    $sql = '(';
                    $sql .= "(sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND sys_perm_user like '%$perm%') OR  ";
                    $sql .= "(sys_groupid IN (".$groups.") AND sys_perm_group like '%$perm%') OR ";
                    $sql .= "sys_perm_other like '%$perm%'";
                    $sql .= "(" . $table . "sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND " . $table . "sys_perm_user like '%$perm%') OR  ";
                    $sql .= "(" . $table . "sys_groupid IN (".$groups.") AND " . $table ."sys_perm_group like '%$perm%') OR ";
                    $sql .= $table . "sys_perm_other like '%$perm%'";
                    $sql .= ')';
                    return $sql;
interface/web/sites/list/web_domain.list.php
@@ -74,7 +74,7 @@
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                                        'querystring' => 'SELECT a.server_id, a.server_name FROM server a, web_domain b WHERE (a.server_id = b.server_id) AND ({AUTHSQL-B}) ORDER BY a.server_name',
                                                        'keyfield'=> 'server_id',
                                                        'valuefield'=> 'server_name'
                                                       ),