Changeset 979
- Timestamp:
- 02/17/07 16:34:41 (2 years ago)
- Files:
-
- devel/units/users/userdetails_edit.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/units/users/userdetails_edit.php
r751 r979 1 1 <?php 2 2 3 global $page_owner, $CFG;4 5 if (user_type($page_owner) == 'person' && run("permissions:check",array("userdetails:change", $page_owner))) {6 7 $info = get_record('users','ident',$page_owner);8 $name = htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8');9 $email = htmlspecialchars(stripslashes($info->email), ENT_COMPAT, 'utf-8');3 global $page_owner, $CFG; 4 5 if (user_type($page_owner) == 'person' && run("permissions:check",array("userdetails:change", $page_owner))) { 6 7 $info = get_record('users','ident',$page_owner); 8 $name = htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8'); 9 $email = htmlspecialchars(stripslashes($info->email), ENT_COMPAT, 'utf-8'); 10 10 11 11 $changeName = __gettext("Change your full name:"); // gettext variable … … 34 34 $emailRules = __gettext("This will not be displayed to other users; you can choose to make an email address available via the profile screen."); // gettext variable 35 35 $body .= <<< END 36 36 37 37 <h2> 38 38 $emailAddress … … 51 51 ); 52 52 53 $friendAddress = __gettext("Friendship moderation:"); // gettext variable54 $friendRules = __gettext("This allows you to choose who can list you as a friend."); // gettext variable55 $body .= <<< END56 53 $friendAddress = __gettext("Friendship moderation:"); // gettext variable 54 $friendRules = __gettext("This allows you to choose who can list you as a friend."); // gettext variable 55 $body .= <<< END 56 57 57 <h2> 58 58 $friendAddress … … 64 64 END; 65 65 66 $friendlevel = "<select name=\"moderation\">";67 $friendlevel .= "<option value=\"no\" ";68 if ($info->moderation == "no") {69 $friendlevel .= "selected=\"selected\"";70 }71 $friendlevel .= ">" . __gettext("No moderation: anyone can list you as a friend. (Recommended)") . "</option>";72 $friendlevel .= "<option value=\"yes\" ";73 if ($info->moderation == "yes") {74 $friendlevel .= "selected=\"selected\"";75 }76 $friendlevel .= ">" . __gettext("Moderation: friendships must be approved by you.") . "</option>";77 $friendlevel .= "<option value=\"priv\" ";78 if ($info->moderation == "priv") {79 $friendlevel .= "selected=\"selected\"";80 }81 $friendlevel .= ">" . __gettext("Private: nobody can list you as a friend.") . "</option>";82 $friendlevel .= "</select>";83 84 $body .= templates_draw(array(66 $friendlevel = "<select name=\"moderation\">"; 67 $friendlevel .= "<option value=\"no\" "; 68 if ($info->moderation == "no") { 69 $friendlevel .= "selected=\"selected\""; 70 } 71 $friendlevel .= ">" . __gettext("No moderation: anyone can list you as a friend. (Recommended)") . "</option>"; 72 $friendlevel .= "<option value=\"yes\" "; 73 if ($info->moderation == "yes") { 74 $friendlevel .= "selected=\"selected\""; 75 } 76 $friendlevel .= ">" . __gettext("Moderation: friendships must be approved by you.") . "</option>"; 77 $friendlevel .= "<option value=\"priv\" "; 78 if ($info->moderation == "priv") { 79 $friendlevel .= "selected=\"selected\""; 80 } 81 $friendlevel .= ">" . __gettext("Private: nobody can list you as a friend.") . "</option>"; 82 $friendlevel .= "</select>"; 83 84 $body .= templates_draw(array( 85 85 'context' => 'databox', 86 86 'name' => __gettext("Friendship moderation"), … … 88 88 ) 89 89 ); 90 90 91 if (!$CFG->disable_publiccomments) { 91 92 $emailReplies = __gettext("Make comments public"); 92 93 $emailRules = __gettext("Set this to 'yes' if you would like anyone to be able to comment on your resources (by default only logged-in users can). Note that this may make you vulnerable to spam."); … … 101 102 END; 102 103 103 if (!$CFG->disable_publiccomments) {104 104 $publiccomments = user_flag_get("publiccomments",$page_owner); 105 105 if ($publiccomments) { … … 119 119 } 120 120 } 121 121 122 122 $emailReplies = __gettext("Receive email notifications"); 123 $emailRules = __gettext("Set this to 'yes' if you would like to receive email copies of any messages you receive. This includes blog comments, notifications when people add you as a friend and more. You can always view these online as part of your recent activity page.");124 125 $body .= <<< END123 $emailRules = __gettext("Set this to 'yes' if you would like to receive email copies of any messages you receive. This includes blog comments, notifications when people add you as a friend and more. You can always view these online as part of your recent activity page."); 124 125 $body .= <<< END 126 126 127 127 <h2>$emailReplies</h2> … … 148 148 ); 149 149 } 150 150 151 151 $password = __gettext("Change your password:"); // gettext variable 152 152 $passwordRules = __gettext("Leave this blank if you're happy to leave your password as it is."); // gettext variable 153 153 $body .= <<< END 154 154 155 155 <h2> 156 156 $password … … 177 177 178 178 // Allow plug-ins to add stuff ... 179 $body .= run("userdetails:edit:details");180 181 $id = $page_owner;182 183 $save = __gettext("Save");184 185 $body .= <<< END186 179 $body .= run("userdetails:edit:details"); 180 181 $id = $page_owner; 182 183 $save = __gettext("Save"); 184 185 $body .= <<< END 186 187 187 <p align="center"> 188 188 <input type="hidden" name="action" value="userdetails:update" /> … … 190 190 <input type="hidden" name="profile_id" value="$page_owner" /> 191 191 END; 192 if (context == "admin") {193 $body .= '<input type="hidden" name="context" value="admin" />';194 }195 $body .= <<< END192 if (context == "admin") { 193 $body .= '<input type="hidden" name="context" value="admin" />'; 194 } 195 $body .= <<< END 196 196 <input type="submit" value="$save" /> 197 197 </p> … … 202 202 203 203 $run_result .= $body; 204 }204 } 205 205 206 206 ?>
