summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-08-02 21:52:50 +0200
committerAndreas Gohr <andi@splitbrain.org>2013-08-02 21:52:50 +0200
commit395e7d8e1e303ae87be5d88abc67947b89e1a5a4 (patch)
tree4e91abd30543ca241c8528ab75d6a2264c43d151 /inc/actions.php
parent5b230a45afb9bb825ba148e699bdcbfc57957fb4 (diff)
parent836a17626793ab95d666c62e9c21b3df2568eeb4 (diff)
downloadrpg-395e7d8e1e303ae87be5d88abc67947b89e1a5a4.tar.gz
rpg-395e7d8e1e303ae87be5d88abc67947b89e1a5a4.tar.bz2
Merge branch 'pull-request-245'
* pull-request-245: coding corrections. correct type hint, remove unused variable assignment HTTPClient don't pull too much bytes when no content-length is given de/de-informal: localization updates (delete user function) unit tests for self deleting of user accounts FS#2751 - self deletion of user account Conflicts: inc/lang/de-informal/lang.php inc/lang/de/lang.php
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/inc/actions.php b/inc/actions.php
index da3414eb2..bf124c887 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -92,14 +92,26 @@ function act_dispatch(){
$ACT = 'login';
}
- //update user profile
- if ($ACT == 'profile') {
+ // user profile changes
+ if (in_array($ACT, array('profile','profile_delete'))) {
if(!$_SERVER['REMOTE_USER']) {
$ACT = 'login';
} else {
- if(updateprofile()) {
- msg($lang['profchanged'],1);
- $ACT = 'show';
+ switch ($ACT) {
+ case 'profile' :
+ if(updateprofile()) {
+ msg($lang['profchanged'],1);
+ $ACT = 'show';
+ }
+ break;
+ case 'profile_delete' :
+ if(auth_deleteprofile()){
+ msg($lang['profdeleted'],1);
+ $ACT = 'show';
+ } else {
+ $ACT = 'profile';
+ }
+ break;
}
}
}
@@ -247,7 +259,7 @@ function act_validate($act) {
//disable all acl related commands if ACL is disabled
if(!$conf['useacl'] && in_array($act,array('login','logout','register','admin',
'subscribe','unsubscribe','profile','revert',
- 'resendpwd'))){
+ 'resendpwd','profile_delete'))){
msg('Command unavailable: '.htmlspecialchars($act),-1);
return 'show';
}
@@ -258,7 +270,7 @@ function act_validate($act) {
if(!in_array($act,array('login','logout','register','save','cancel','edit','draft',
'preview','search','show','check','index','revisions',
'diff','recent','backlink','admin','subscribe','revert',
- 'unsubscribe','profile','resendpwd','recover',
+ 'unsubscribe','profile','profile_delete','resendpwd','recover',
'draftdel','sitemap','media')) && substr($act,0,7) != 'export_' ) {
msg('Command unknown: '.htmlspecialchars($act),-1);
return 'show';
@@ -287,7 +299,7 @@ function act_permcheck($act){
}else{
$permneed = AUTH_CREATE;
}
- }elseif(in_array($act,array('login','search','recent','profile','index', 'sitemap'))){
+ }elseif(in_array($act,array('login','search','recent','profile','profile_delete','index', 'sitemap'))){
$permneed = AUTH_NONE;
}elseif($act == 'revert'){
$permneed = AUTH_ADMIN;