Revision 1796
Added by Dietmar about 12 years ago
branches/2.8.x/CHANGELOG | ||
---|---|---|
13 | 13 |
|
14 | 14 |
|
15 | 15 |
|
16 |
24 Oct-2012 Build 1796 Dietmar Woellbrink (Luisehahne) |
|
17 |
! supress frontend preferences, if user have no permission for it |
|
16 | 18 |
24 Oct-2012 Build 1795 Dietmar Woellbrink (Luisehahne) |
17 | 19 |
! change setting of the $_SESSION['SYSTEM_PERMISSIONS'] |
18 | 20 |
from get_user_id to ami_group_member, sp that all Users |
branches/2.8.x/wb/admin/interface/version.php | ||
---|---|---|
51 | 51 |
|
52 | 52 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
53 | 53 |
if(!defined('VERSION')) define('VERSION', '2.8.3'); |
54 |
if(!defined('REVISION')) define('REVISION', '1795');
|
|
54 |
if(!defined('REVISION')) define('REVISION', '1796');
|
|
55 | 55 |
if(!defined('SP')) define('SP', ''); |
branches/2.8.x/wb/account/preferences.php | ||
---|---|---|
27 | 27 |
require_once(WB_PATH.'/framework/functions.php'); |
28 | 28 |
|
29 | 29 |
$wb = new frontend(false); |
30 |
$permission = new admin('##skip##'); |
|
30 | 31 |
|
31 | 32 |
if(!FRONTEND_LOGIN) { |
32 | 33 |
$wb->send_header('Location: '.WB_URL.'/'); |
... | ... | |
37 | 38 |
$wb->send_header('Location: '.WB_URL.'/account/login.php'); |
38 | 39 |
exit(0); |
39 | 40 |
} |
41 |
|
|
42 |
if ($permission->get_permission('preferences')==false) { |
|
43 |
$wb->send_header('Location: '.WB_URL.'/'); |
|
44 |
exit(0); |
|
45 |
} |
|
46 |
|
|
40 | 47 |
$page_id = defined('REFERRER_ID') ? REFERRER_ID : isset($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0; |
41 | 48 |
|
42 | 49 |
// Required page details |
branches/2.8.x/wb/framework/class.wb.php | ||
---|---|---|
45 | 45 |
*/ |
46 | 46 |
public function GetLanguagesDetailsInUsed ( ) { |
47 | 47 |
global $database; |
48 |
$retVal = array();
|
|
48 |
$aRetval = array();
|
|
49 | 49 |
$sql = |
50 | 50 |
'SELECT DISTINCT `language`'. |
51 | 51 |
', `page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,`language`'. |
... | ... | |
63 | 63 |
while($page = $oRes->fetchRow(MYSQL_ASSOC)) |
64 | 64 |
{ |
65 | 65 |
if(!$this->page_is_visible($page)) {continue;} |
66 |
$retVal[$page['language']] = $page;
|
|
66 |
$aRetval[$page['language']] = $page;
|
|
67 | 67 |
} |
68 | 68 |
} |
69 |
return $retVal;
|
|
69 |
return $aRetval;
|
|
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
/** |
... | ... | |
76 | 76 |
* |
77 | 77 |
*/ |
78 | 78 |
public function GetLanguagesInUsed ( ) { |
79 |
global $database; |
|
80 |
$retVal = ''; |
|
81 |
$page = array(); |
|
82 |
$sql = |
|
83 |
'SELECT DISTINCT `language`'. |
|
84 |
', `page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,`language`'. |
|
85 |
', `visibility`,`viewing_groups`,`viewing_users`,`position` '. |
|
86 |
'FROM `'.TABLE_PREFIX.'pages` '. |
|
87 |
'WHERE `level`= \'0\' '. |
|
88 |
'AND `root_parent`=`page_id` '. |
|
89 |
'AND `visibility`!=\'none\' '. |
|
90 |
'AND `visibility`!=\'hidden\' '. |
|
91 |
'GROUP BY `language` '. |
|
92 |
'ORDER BY `position`'; |
|
79 |
return implode(',', array_keys($this->GetLanguagesDetailsInUsed())); |
|
80 |
} |
|
93 | 81 |
|
94 |
if($oRes = $database->query($sql)) |
|
95 |
{ |
|
96 |
while($page = $oRes->fetchRow(MYSQL_ASSOC)) |
|
97 |
{ |
|
98 |
if(!$this->page_is_visible($page)) {continue;} |
|
99 |
$retVal .= $page['language'].','; |
|
100 |
} |
|
101 |
} |
|
102 |
return trim($retVal,','); |
|
103 |
} |
|
104 | 82 |
|
105 |
|
|
106 | 83 |
/* **************** |
107 | 84 |
* check if one or more group_ids are in both group_lists |
108 | 85 |
* |
branches/2.8.x/wb/framework/class.frontend.php | ||
---|---|---|
24 | 24 |
//require_once(WB_PATH.'/framework/class.wb.php'); |
25 | 25 |
//require_once(WB_PATH.'/framework/SecureForm.php'); |
26 | 26 |
if(!class_exists('wb', false)){ require(WB_PATH.'/framework/class.wb.php'); } |
27 |
if(!class_exists('admin', false)){ require(WB_PATH.'/framework/class.admin.php'); } |
|
27 | 28 |
|
28 | 29 |
class frontend extends wb { |
29 | 30 |
// defaults |
Also available in: Unified diff
! supress frontend preferences, if user have no permission for it