]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
[friendica.git] / mod / settings.php
index 2dd9fb9a682bd99750a491ea6e13229160ed31db..5f5b2ab2e97e1831740a8446b18e1dd4ac16f071 100644 (file)
@@ -75,6 +75,11 @@ EOT;
                        'label' => t('Export personal data'),
                        'url' => $a->get_baseurl(true) . '/uexport',
                        'selected' => ''
+               ),
+               array(
+                       'label' => t('Remove account'),
+                       'url' => $a->get_baseurl(true) . '/removeme',
+                       'selected' => ''
                )
        );
        
@@ -346,6 +351,9 @@ function settings_post(&$a) {
        $suggestme        = ((x($_POST,'suggestme')) ? intval($_POST['suggestme'])  : 0);  
        $hide_friends     = (($_POST['hide-friends'] == 1) ? 1: 0);
        $hidewall         = (($_POST['hidewall'] == 1) ? 1: 0);
+       $post_newfriend   = (($_POST['post_newfriend'] == 1) ? 1: 0);
+       $post_joingroup   = (($_POST['post_joingroup'] == 1) ? 1: 0);
+       $post_profilechange   = (($_POST['post_profilechange'] == 1) ? 1: 0);
 
 
        $notify = 0;
@@ -428,6 +436,9 @@ function settings_post(&$a) {
        set_pconfig(local_user(),'expire','photos', $expire_photos);
 
        set_pconfig(local_user(),'system','suggestme', $suggestme);
+       set_pconfig(local_user(),'system','post_newfriend', $post_newfriend);
+       set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
+       set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
 
 
        $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d, `blocktags` = %d, `unkmail` = %d, `cntunkmail` = %d  WHERE `uid` = %d LIMIT 1",
@@ -692,8 +703,8 @@ function settings_content(&$a) {
                $allowed_themes_raw = explode(',',$allowed_themes_str);
                $allowed_themes = array();
                if(count($allowed_themes_raw))
-                       foreach($allowed_themes_raw as $x)
-                               if(strlen(trim($x)))
+                       foreach($allowed_themes_raw as $x) 
+                               if(strlen(trim($x)) && is_dir("view/theme/$x"))
                                        $allowed_themes[] = trim($x);
 
                
@@ -790,6 +801,14 @@ function settings_content(&$a) {
        $suggestme = get_pconfig(local_user(), 'system','suggestme');
        $suggestme = (($suggestme===false)? '0': $suggestme); // default if not set: 0
 
+       $post_newfriend = get_pconfig(local_user(), 'system','post_newfriend');
+       $post_newfriend = (($post_newfriend===false)? '0': $post_newfriend); // default if not set: 0
+
+       $post_joingroup = get_pconfig(local_user(), 'system','post_joingroup');
+       $post_joingroup = (($post_joingroup===false)? '0': $post_joingroup); // default if not set: 0
+
+       $post_profilechange = get_pconfig(local_user(), 'system','post_profilechange');
+       $post_profilechange = (($post_profilechange===false)? '0': $post_profilechange); // default if not set: 0
 
        
        if(! strlen($a->user['timezone']))
@@ -878,6 +897,8 @@ function settings_content(&$a) {
        ));
 
 
+
+
        $invisible = (((! $profile['publish']) && (! $profile['net-publish']))
                ? true : false);
 
@@ -958,6 +979,10 @@ function settings_content(&$a) {
                
                
                '$h_not'        => t('Notification Settings'),
+               '$activity_options' => t('By default post a status message when:'),
+               '$post_newfriend' => array('post_newfriend',  t('accepting a friend request'), $post_newfriend, ''),
+               '$post_joingroup' => array('post_joingroup',  t('joining a forum/community'), $post_joingroup, ''),
+               '$post_profilechange' => array('post_profilechange',  t('making an <em>interesting</em> profile change'), $post_profilechange, ''),
                '$lbl_not'      => t('Send a notification email when:'),
                '$notify1'      => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),
                '$notify2'      => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''),