mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
capability riskbitmasks and user trustbitmask patch #1 see MDL-6412
This commit is contained in:
parent
2b3447c38a
commit
be4486da83
7 changed files with 34 additions and 9 deletions
|
@ -583,7 +583,8 @@
|
|||
<FIELD NAME="ajax" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="htmleditor" NEXT="autosubscribe"/>
|
||||
<FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="ajax" NEXT="trackforums"/>
|
||||
<FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="autosubscribe" NEXT="timemodified"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="trackforums"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="trackforums" NEXT="trustbitmask"/>
|
||||
<FIELD NAME="trustbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Default comment for the field, please edit me" PREVIOUS="timemodified"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user"/>
|
||||
|
@ -915,7 +916,8 @@
|
|||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="captype"/>
|
||||
<FIELD NAME="captype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="contextlevel"/>
|
||||
<FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="captype" NEXT="component"/>
|
||||
<FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="contextlevel"/>
|
||||
<FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="contextlevel" NEXT="riskbitmask"/>
|
||||
<FIELD NAME="riskbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Default comment for the field, please edit me" PREVIOUS="component"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for capabilities" NEXT="name"/>
|
||||
|
|
|
@ -2165,6 +2165,10 @@ function main_upgrade($oldversion=0) {
|
|||
table_column('sessions2', 'sessdata', 'sessdata', 'LONGTEXT', '', '', '', '', '');
|
||||
}
|
||||
|
||||
if ($oldversion < 2006083002) {
|
||||
table_column('capabilities', '', 'riskbitmask', 'INTEGER', '10', 'unsigned', '0', 'not null', '');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -985,6 +985,7 @@ CREATE TABLE prefix_capabilities (
|
|||
`captype` varchar(50) NOT NULL default '',
|
||||
`contextlevel` int(10) unsigned NOT NULL default '0',
|
||||
`component` varchar(100) NOT NULL default '',
|
||||
`riskbitmask` int(10) unsigned NOT NULL default '0',
|
||||
UNIQUE KEY `name` (`name`),
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MYISAM COMMENT ='this defines all capabilities';
|
||||
|
|
|
@ -1759,6 +1759,10 @@ function main_upgrade($oldversion=0) {
|
|||
execute_sql("
|
||||
CREATE INDEX {$CFG->prefix}sess_exp2_ix ON {$CFG->prefix}sessions2 (expireref);", true);
|
||||
}
|
||||
|
||||
if ($oldversion < 2006083002) {
|
||||
table_column('capabilities', '', 'riskbitmask', 'INTEGER', '10', 'unsigned', '0', 'not null', '');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -750,6 +750,7 @@ CREATE TABLE prefix_capabilities (
|
|||
captype varchar(50) NOT NULL default '',
|
||||
contextlevel integer NOT NULL default 0,
|
||||
component varchar(100) NOT NULL default ''
|
||||
riskbitmask integer NOT NULL default 0,
|
||||
);
|
||||
CREATE UNIQUE INDEX prefix_capabilities_name_idx ON prefix_capabilities (name);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue