summaryrefslogtreecommitdiff
path: root/lib/plugins/authplain/auth.php
diff options
context:
space:
mode:
authorPatrick Brown <ptbrown@whoopdedo.org>2015-05-07 14:27:00 -0400
committerPatrick Brown <ptbrown@whoopdedo.org>2015-05-07 14:27:00 -0400
commit699e3c4900f2d6cc860a3587a05798cd23b7944d (patch)
tree896cdac4eb8a7b448d4c73d314bba9d20f21f896 /lib/plugins/authplain/auth.php
parent1bd6bbdebc26f9cd916f8f287cd2cabc07bee8d1 (diff)
downloadrpg-699e3c4900f2d6cc860a3587a05798cd23b7944d.tar.gz
rpg-699e3c4900f2d6cc860a3587a05798cd23b7944d.tar.bz2
Use io_replaceInFile for updating auth
Diffstat (limited to 'lib/plugins/authplain/auth.php')
-rw-r--r--lib/plugins/authplain/auth.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/plugins/authplain/auth.php b/lib/plugins/authplain/auth.php
index b31c02fc8..35cf7a802 100644
--- a/lib/plugins/authplain/auth.php
+++ b/lib/plugins/authplain/auth.php
@@ -185,14 +185,9 @@ class auth_plugin_authplain extends DokuWiki_Auth_Plugin {
$userline = $this->_createUserLine($newuser, $userinfo['pass'], $userinfo['name'], $userinfo['mail'], $userinfo['grps']);
- if(!$this->deleteUsers(array($user))) {
- msg('Unable to modify user data. Please inform the Wiki-Admin', -1);
- return false;
- }
-
- if(!io_saveFile($config_cascade['plainauth.users']['default'], $userline, true)) {
- msg('There was an error modifying your user data. You should register again.', -1);
- // FIXME, user has been deleted but not recreated, should force a logout and redirect to login page
+ if(!io_replaceInFile($config_cascade['plainauth.users']['default'], '/^'.$user.':/', $userline, true)) {
+ msg('There was an error modifying your user data. You may need to register again.', -1);
+ // FIXME, io functions should be fail-safe so existing data isn't lost
$ACT = 'register';
return false;
}