Changeset 703
- Timestamp:
- 11/09/06 14:49:59 (2 years ago)
- Files:
-
- devel/config-dist.php (modified) (1 diff)
- devel/htaccess-dist (modified) (1 diff)
- devel/lib/setup.php (modified) (1 diff)
- devel/units/users/userdetails_actions.php (modified) (2 diffs)
- devel/units/users/userdetails_edit.php (modified) (2 diffs)
- devel/units/weblogs/weblogs_actions.php (modified) (1 diff)
- devel/units/weblogs/weblogs_posts_view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/config-dist.php
r542 r703 81 81 $CFG->default_access = "LOGGED_IN"; 82 82 83 // Set the following to true to force users to log in before they can post comments, overriding per-user option 84 // Handy sledgehammer-to-crack-a-nut to protect against comment spam. 85 $CFG->disable_publiccomments = false; 86 83 87 // dataroot. this is where uploaded files will go (and sessions for now) 84 88 // This should be OUTSIDE your wwwroot. devel/htaccess-dist
r694 r703 7 7 8 8 Options +FollowSymLinks 9 10 # PHP defaults to allowing file uploads of max 2MB, below is example option for 5MB. 11 # NB: Adjusting value may not work, depending on other configured php and apache limits 12 #php_value upload_max_filesize 5242880 9 13 10 14 # Not really necessary, just to be clean devel/lib/setup.php
r701 r703 60 60 if (empty($CFG->disable_templatechanging)) { 61 61 $CFG->disable_templatechanging = false; 62 } 63 64 if (empty($CFG->disable_publiccomments)) { 65 $CFG->disable_publiccomments = false; 62 66 } 63 67 devel/units/users/userdetails_actions.php
r659 r703 2 2 3 3 // Userdetails actions 4 global $USER ;4 global $USER, $CFG; 5 5 global $page_owner; 6 6 … … 48 48 } 49 49 50 $publiccomments = optional_param('publiccomments'); 51 if ($usertype == 'person' && !empty($publiccomments)) { 52 if ($publiccomments == "yes") { 53 user_flag_set("publiccomments", "1", $id); 54 $messages[] = __gettext("Public comments and discussion set to 'on'."); 55 } else { 56 user_flag_unset("publiccomments",$id); 57 $messages[] = __gettext("Public comments and discussion set to 'off'."); 50 if (!$CFG->disable_publiccomments) { 51 $publiccomments = optional_param('publiccomments'); 52 if ($usertype == 'person' && !empty($publiccomments)) { 53 if ($publiccomments == "yes") { 54 user_flag_set("publiccomments", "1", $id); 55 $messages[] = __gettext("Public comments and discussion set to 'on'."); 56 } else { 57 user_flag_unset("publiccomments",$id); 58 $messages[] = __gettext("Public comments and discussion set to 'off'."); 59 } 58 60 } 59 61 } devel/units/users/userdetails_edit.php
r659 r703 1 1 <?php 2 2 3 global $page_owner ;3 global $page_owner, $CFG; 4 4 5 5 if (user_type($page_owner) == 'person' && run("permissions:check",array("userdetails:change", $page_owner))) { … … 101 101 END; 102 102 103 $emailreplies = user_flag_get("publiccomments",$page_owner); 104 if ($emailreplies) { 105 $body .= templates_draw(array( 106 'context' => 'databox', 107 'name' => __gettext("Public comments: "), 108 'column1' => "<label><input type=\"radio\" name=\"publiccomments\" value=\"yes\" checked=\"checked\" /> " . __gettext("Yes") . "</label> <label><input type=\"radio\" name=\"publiccomments\" value=\"no\" /> " . __gettext("No") . "</label>" 109 ) 110 ); 111 } else { 112 $body .= templates_draw(array( 113 'context' => 'databox', 114 'name' => __gettext("Public comments: "), 115 'column1' => "<label><input type=\"radio\" name=\"publiccomments\" value=\"yes\" /> " . __gettext("Yes") . "</label> <label><input type=\"radio\" name=\"publiccomments\" value=\"no\" checked=\"checked\" /> " . __gettext("No") . "</label>" 116 ) 117 ); 103 if (!$CFG->disable_publiccomments) { 104 $publiccomments = user_flag_get("publiccomments",$page_owner); 105 if ($publiccomments) { 106 $body .= templates_draw(array( 107 'context' => 'databox', 108 'name' => __gettext("Public comments: "), 109 'column1' => "<label><input type=\"radio\" name=\"publiccomments\" value=\"yes\" checked=\"checked\" /> " . __gettext("Yes") . "</label> <label><input type=\"radio\" name=\"publiccomments\" value=\"no\" /> " . __gettext("No") . "</label>" 110 ) 111 ); 112 } else { 113 $body .= templates_draw(array( 114 'context' => 'databox', 115 'name' => __gettext("Public comments: "), 116 'column1' => "<label><input type=\"radio\" name=\"publiccomments\" value=\"yes\" /> " . __gettext("Yes") . "</label> <label><input type=\"radio\" name=\"publiccomments\" value=\"no\" checked=\"checked\" /> " . __gettext("No") . "</label>" 117 ) 118 ); 119 } 118 120 } 119 121 devel/units/weblogs/weblogs_actions.php
r659 r703 134 134 if (run("spam:check",$comment->body) != true) { 135 135 // If we're logged on or comments are public, add one 136 if (logged_on || user_flag_get("publiccomments",$post->owner)) {136 if (logged_on || (!$CFG->disable_publiccomments && user_flag_get("publiccomments",$post->owner)) ) { 137 137 $comment->owner = $USER->ident; 138 138 $comment->posted = time(); devel/units/weblogs/weblogs_posts_view.php
r694 r703 200 200 ); 201 201 202 if (logged_on || user_flag_get("publiccomments",$post->owner)) {202 if (logged_on || (!$CFG->disable_publiccomments && user_flag_get("publiccomments",$post->owner)) ) { 203 203 $run_result .= run("weblogs:comments:add",$post); 204 204 } else {
