Changeset 502 for trunk/lib/ACL.inc.php
- Timestamp:
- Dec 30, 2014 10:24:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/ACL.inc.php
r484 r502 37 37 require_once dirname(__FILE__) . '/Cache.inc.php'; 38 38 39 class ACL { 39 class ACL 40 { 40 41 41 42 // A place to keep an object instance for the singleton pattern. … … 49 50 // Automatically create table and verify columns. Better set to false after site launch. 50 51 'create_table' => false, 52 53 // Maximum allowed length of names. 54 // This value can be increased only if {aro,aco,axo}_tbl.name VARCHAR length is increased. 55 'name_max_length' => 32. 51 56 ); 52 57 … … 149 154 $db->query(" 150 155 CREATE TABLE IF NOT EXISTS acl_tbl ( 151 aro_id SMALLINT (11)UNSIGNED NOT NULL DEFAULT '0',152 aco_id SMALLINT (11)UNSIGNED NOT NULL DEFAULT '0',153 axo_id SMALLINT (11)UNSIGNED NOT NULL DEFAULT '0',156 aro_id SMALLINT UNSIGNED NOT NULL DEFAULT '0', 157 aco_id SMALLINT UNSIGNED NOT NULL DEFAULT '0', 158 axo_id SMALLINT UNSIGNED NOT NULL DEFAULT '0', 154 159 access ENUM('allow', 'deny') DEFAULT NULL, 155 160 added_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', … … 180 185 CREATE TABLE IF NOT EXISTS {$a_o}_tbl ( 181 186 {$a_o}_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 182 name VARCHAR( 32) NOT NULL DEFAULT '',183 lft MEDIUMINT (9)UNSIGNED NOT NULL DEFAULT '0',184 rgt MEDIUMINT (9)UNSIGNED NOT NULL DEFAULT '0',187 name VARCHAR(" . $this->getParam('name_max_length') . ") NOT NULL DEFAULT '', 188 lft MEDIUMINT UNSIGNED NOT NULL DEFAULT '0', 189 rgt MEDIUMINT UNSIGNED NOT NULL DEFAULT '0', 185 190 added_datetime DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', 186 191 UNIQUE KEY name (name(15)), … … 255 260 if ('' == trim($name) || '' == trim($parent)) { 256 261 $app->logMsg(sprintf('Cannot add node, parent (%s) or name (%s) missing.', $name, $parent), LOG_WARNING, __FILE__, __LINE__); 262 return false; 263 } 264 265 // Ensure node node name fits in the column size. 266 // This value can be increased if {aro,aco.axo}_tbl.name VARCHAR length is increased. 267 if (strlen(trim($name)) > $this->getParam('name_max_length')) { 268 $app->logMsg(sprintf('Cannot add node, %s character limit exceeded for name "%s"', $this->getParam('name_max_length'), $name, $parent), LOG_WARNING, __FILE__, __LINE__); 257 269 return false; 258 270 } … … 718 730 719 731 if (!$this->check($aro, $aco, $axo)) { 720 $message = '' == trim($message) ? sprintf(_(" You have insufficient privileges to view <em>%s %s</em>"), $aco, $axo) : $message;732 $message = '' == trim($message) ? sprintf(_("Sorry, you have insufficient privileges for <em>%s %s</em>."), $aco, $axo) : $message; 721 733 $app->raiseMsg($message, $type, $file, $line); 722 734 $app->dieBoomerangURL();
Note: See TracChangeset
for help on using the changeset viewer.