@@ -142,7 +142,7 @@ function onAfterInsert() {
142142 $ username = $ app ->db ->quote ($ this ->dataRecord ["username " ]);
143143 $ password = $ app ->db ->quote ($ this ->dataRecord ["password " ]);
144144 $ modules = $ conf ['interface_modules_enabled ' ];
145- if ($ this ->dataRecord ["limit_client " ] > 0 ) $ modules .= ',client ' ;
145+ if (isset ( $ this -> dataRecord [ " limit_client " ]) && $ this ->dataRecord ["limit_client " ] > 0 ) $ modules .= ',client ' ;
146146 $ startmodule = (stristr ($ modules ,'dashboard ' ))?'dashboard ' :'client ' ;
147147 $ usertheme = $ app ->db ->quote ($ this ->dataRecord ["usertheme " ]);
148148 $ type = 'user ' ;
@@ -194,9 +194,8 @@ function onAfterInsert() {
194194 */
195195 function onAfterUpdate () {
196196 global $ app ;
197-
198197 // username changed
199- if ($ conf ['demo_mode ' ] != true && isset ($ this ->dataRecord ['username ' ]) && $ this ->dataRecord ['username ' ] != '' && $ this ->oldDataRecord ['username ' ] != $ this ->dataRecord ['username ' ]) {
198+ if (isset ( $ conf [ ' demo_mode ' ]) && $ conf ['demo_mode ' ] != true && isset ($ this ->dataRecord ['username ' ]) && $ this ->dataRecord ['username ' ] != '' && $ this ->oldDataRecord ['username ' ] != $ this ->dataRecord ['username ' ]) {
200199 $ username = $ app ->db ->quote ($ this ->dataRecord ["username " ]);
201200 $ client_id = $ this ->id ;
202201 $ sql = "UPDATE sys_user SET username = ' $ username' WHERE client_id = $ client_id " ;
@@ -208,7 +207,7 @@ function onAfterUpdate() {
208207 }
209208
210209 // password changed
211- if ($ conf ['demo_mode ' ] != true && isset ($ this ->dataRecord ["password " ]) && $ this ->dataRecord ["password " ] != '' ) {
210+ if (isset ( $ conf [ ' demo_mode ' ]) && $ conf ['demo_mode ' ] != true && isset ($ this ->dataRecord ["password " ]) && $ this ->dataRecord ["password " ] != '' ) {
212211 $ password = $ app ->db ->quote ($ this ->dataRecord ["password " ]);
213212 $ salt ="$1$ " ;
214213 $ base64_alphabet ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ ' ;
@@ -223,7 +222,7 @@ function onAfterUpdate() {
223222 }
224223
225224 // language changed
226- if ($ conf ['demo_mode ' ] != true && isset ($ this ->dataRecord ['language ' ]) && $ this ->dataRecord ['language ' ] != '' && $ this ->oldDataRecord ['language ' ] != $ this ->dataRecord ['language ' ]) {
225+ if (isset ( $ conf [ ' demo_mode ' ]) && $ conf ['demo_mode ' ] != true && isset ($ this ->dataRecord ['language ' ]) && $ this ->dataRecord ['language ' ] != '' && $ this ->oldDataRecord ['language ' ] != $ this ->dataRecord ['language ' ]) {
227226 $ language = $ app ->db ->quote ($ this ->dataRecord ["language " ]);
228227 $ client_id = $ this ->id ;
229228 $ sql = "UPDATE sys_user SET language = ' $ language' WHERE client_id = $ client_id " ;
0 commit comments