Skip to content

Commit

Permalink
FKS : Issue #2 - Use NULL userid / modifierid instead of 0 during ins…
Browse files Browse the repository at this point in the history
…tallation
  • Loading branch information
asafo committed Sep 24, 2015
1 parent bad8192 commit 42139cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ function assign_capability($capability, $permission, $roleid, $contextid, $overw
$cap->capability = $capability;
$cap->permission = $permission;
$cap->timemodified = time();
$cap->modifierid = empty($USER->id) ? 0 : $USER->id;
$cap->modifierid = empty($USER->id) ? NULL : $USER->id;

if ($existing) {
$cap->id = $existing->id;
Expand Down
2 changes: 1 addition & 1 deletion lib/datalib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ function add_to_config_log($name, $oldvalue, $value, $plugin) {
global $USER, $DB;

$log = new stdClass();
$log->userid = during_initial_install() ? 0 :$USER->id; // 0 as user id during install
$log->userid = during_initial_install() ? NULL :$USER->id; // NULL as user id during install
$log->timemodified = time();
$log->name = $name;
$log->oldvalue = $oldvalue;
Expand Down
4 changes: 2 additions & 2 deletions lib/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<TABLE NAME="config_log" COMMENT="Changes done in server configuration through admin UI">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false"/>
Expand Down Expand Up @@ -1085,7 +1085,7 @@
<FIELD NAME="capability" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="permission" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
Expand Down

0 comments on commit 42139cb

Please sign in to comment.