]> git.mxchange.org Git - friendica.git/blobdiff - mod/profiles.php
default acl's
[friendica.git] / mod / profiles.php
index 26776ff606071018b3e0e32f2c457029e0cbbcbd..db442647446ab2c524e7599d394ed8fa4b8865d7 100644 (file)
@@ -4,7 +4,7 @@
 function profiles_post(&$a) {
 
        if(! local_user()) {
-               $_SESSION['sysmsg'] .= "Unauthorised." . EOL;
+               notice( "Permission denied." . EOL);
                return;
        }
        if(($a->argc > 1) && ($a->argv[1] != "new") && intval($a->argv[1])) {
@@ -63,8 +63,6 @@ function profiles_post(&$a) {
                $education = escape_tags(trim($_POST['education']));
                if(x($_POST,'profile_in_directory'))
                        $publish = (($_POST['profile_in_directory'] == 1) ? 1: 0);
-               if(! in_array($gender,array('','Male','Female','Other')))
-                       $gender = '';
 
                $r = q("UPDATE `profile` 
                        SET `profile-name` = '%s',
@@ -253,9 +251,6 @@ function profiles_content(&$a) {
        }                
 
 
-
-
-
        if(intval($a->argv[1])) {
                $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($a->argv[1]),
@@ -267,7 +262,7 @@ function profiles_content(&$a) {
                }
 
                require_once('mod/profile.php');
-               profile_load($a,$_SESSION['uid'],$r[0]['id']);
+               profile_load($a,$a->user['nickname'],$r[0]['id']);
 
                require_once('view/profile_selectors.php');
 
@@ -278,6 +273,12 @@ function profiles_content(&$a) {
                        '$no_selected' => (($r[0]['publish'] == 0) ? " checked=\"checked\" " : "")
                ));
 
+               $opt_tpl = file_get_contents("view/profile-hide-friends.tpl");
+               $hide_friends = replace_macros($opt_tpl,array(
+                       '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
+                       '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
+               ));
+
 
                $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
                $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>";
@@ -289,13 +290,14 @@ function profiles_content(&$a) {
                $is_default = (($r[0]['is-default']) ? 1 : 0);
                $tpl = file_get_contents("view/profile_edit.tpl");
                $o .= replace_macros($tpl,array(
+                       '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
                        '$baseurl' => $a->get_baseurl(),
                        '$profile_id' => $r[0]['id'],
                        '$profile_name' => $r[0]['profile-name'],
-                       '$default' => (($is_default) ? "<p id=\"profile-edit-default-desc\">This is your <strong>public</strong> profile.</p>" : ""),
+                       '$default' => (($is_default) ? "<p id=\"profile-edit-default-desc\">This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.</p>" : ""),
                        '$name' => $r[0]['name'],
                        '$dob' => dob($r[0]['dob']),
-                       '$hide_birth' => (($r[0]['dob_hide']) ? " checked=\"checked\" " : ""),
+                       '$hide_friends' => $hide_friends,
                        '$address' => $r[0]['address'],
                        '$locality' => $r[0]['locality'],
                        '$region' => $r[0]['region'],