Changeset 1617
- Timestamp:
- Nov 22, 2006, 5:41:25 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r1571 r1617 47 47 $page['section'] = $_GET['section']; 48 48 } 49 50 $general_checkboxes = array( 51 'log', 52 'history_admin', 53 'history_guest', 54 'login_history', 55 'email_admin_on_new_user' 56 ); 57 58 $comments_checkboxes = array( 59 'comments_forall', 60 'comments_validation', 61 'email_admin_on_comment', 62 'email_admin_on_comment_validation', 63 ); 64 49 65 //------------------------------ verification and registration of modifications 50 66 if (isset($_POST['submit']) and !is_adviser()) … … 59 75 array_push($page['errors'], $lang['conf_gallery_url_error']); 60 76 } 61 $_POST['log'] = empty($_POST['log'])?'false':'true';62 $_POST['history_admin'] = empty($_POST['history_admin'])?'false':'true';63 $_POST['history_guest'] = empty($_POST['history_guest'])?'false':'true';64 $_POST['login_history'] = empty($_POST['login_history'])?'false':'true';77 foreach( $general_checkboxes as $checkbox) 78 { 79 $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; 80 } 65 81 break; 66 82 } … … 74 90 { 75 91 array_push($page['errors'], $lang['conf_nb_comment_page_error']); 92 } 93 foreach( $comments_checkboxes as $checkbox) 94 { 95 $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; 76 96 } 77 97 break; … … 161 181 )); 162 182 183 $html_check='checked="checked"'; 184 163 185 switch ($page['section']) 164 186 { 165 187 case 'general' : 166 188 { 167 $html_check='checked="checked"';168 169 189 $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':''; 170 190 $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':''; 171 $history_users = ($conf['log']=='true')?$html_check:'';172 $history_admin = ($conf['history_admin']=='true')?$html_check:'';173 $history_guest = ($conf['history_guest']=='true')?$html_check:'';174 $login_history = ($conf['login_history']=='true')?$html_check:'';175 191 176 192 $template->assign_block_vars( 177 193 'general', 178 194 array( 179 'HISTORY_USERS'=>$history_users,180 'HISTORY_ADMIN'=>$history_admin,181 'HISTORY_GUEST'=>$history_guest,182 'LOGIN_HISTORY'=>$login_history,183 195 'GALLERY_LOCKED_YES'=>$lock_yes, 184 196 'GALLERY_LOCKED_NO'=>$lock_no, … … 190 202 'CONF_GALLERY_URL' => $conf['gallery_url'], 191 203 )); 204 205 foreach( $general_checkboxes as $checkbox) 206 { 207 $template->merge_block_vars( 208 'general', 209 array( 210 strtoupper($checkbox) => ($conf[$checkbox]=='true')?$html_check:'' 211 ) 212 ); 213 } 192 214 break; 193 215 } 194 216 case 'comments' : 195 217 { 196 $all_yes = ($conf['comments_forall']=='true')?'checked="checked"':'';197 $all_no = ($conf['comments_forall']=='false')?'checked="checked"':'';198 $validate_yes = ($conf['comments_validation']=='true')?'checked="checked"':'';199 $validate_no = ($conf['comments_validation']=='false')?'checked="checked"':'';200 201 218 $template->assign_block_vars( 202 219 'comments', 203 220 array( 204 221 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], 205 'COMMENTS_ALL_YES'=>$all_yes,206 'COMMENTS_ALL_NO'=>$all_no,207 'VALIDATE_YES'=>$validate_yes,208 'VALIDATE_NO'=>$validate_no209 222 )); 223 224 foreach( $comments_checkboxes as $checkbox) 225 { 226 $template->merge_block_vars( 227 'comments', 228 array( 229 strtoupper($checkbox) => ($conf[$checkbox]=='true')?$html_check:'' 230 ) 231 ); 232 } 210 233 break; 211 234 } -
trunk/comments.php
r1598 r1617 156 156 // | comments management | 157 157 // +-----------------------------------------------------------------------+ 158 if (is _admin() and !is_adviser())159 { 160 if (isset($_GET['delete']) and is_numeric($_GET['delete']) ) 161 {// comments deletion162 158 if (isset($_GET['delete']) and is_numeric($_GET['delete']) 159 and !is_adviser() ) 160 {// comments deletion 161 check_status(ACCESS_ADMINISTRATOR); 162 $query = ' 163 163 DELETE FROM '.COMMENTS_TABLE.' 164 164 WHERE id='.$_GET['delete'].' 165 165 ;'; 166 pwg_query($query); 167 } 168 169 if (isset($_GET['validate']) and is_numeric($_GET['validate']) ) 170 { // comments validation 171 $query = ' 166 pwg_query($query); 167 } 168 169 if (isset($_GET['validate']) and is_numeric($_GET['validate']) 170 and !is_adviser() ) 171 { // comments validation 172 check_status(ACCESS_ADMINISTRATOR); 173 $query = ' 172 174 UPDATE '.COMMENTS_TABLE.' 173 175 SET validated = \'true\' 174 176 , validation_date = NOW() 175 177 WHERE id='.$_GET['validate'].' 176 178 ;'; 177 178 179 } 179 pwg_query($query); 180 } 181 180 182 // +-----------------------------------------------------------------------+ 181 183 // | page header and options | -
trunk/include/config_default.inc.php
r1616 r1617 516 516 $conf['nbm_treatment_timeout_default'] = 20; 517 517 518 // Send an email to the webmaster when a new user registers519 $conf['email_admin_on_new_user']=false;520 521 518 // +-----------------------------------------------------------------------+ 522 519 // | Set default admin layout | -
trunk/include/picture_comment.inc.php
r1610 r1617 194 194 $template->assign_block_vars('information', 195 195 array('INFORMATION'=>$message)); 196 if ( ($comment_action=='validate' and $conf['email_admin_on_comment']) 197 or $conf['email_admin_on_comment_validation'] ) 198 { 199 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 200 201 $del_url = get_host_url().cookie_path() 202 .'comments.php?delete='.$comm['id']; 203 204 $content = 205 'Author: '.$comm['author']."\n" 206 .'Comment: '.$comm['content']."\n" 207 .'IP: '.$comm['ip']."\n" 208 .'Browser: '.$comm['agent']."\n\n" 209 .'Delete: '.$del_url."\n"; 210 if ($comment_action!='validate') 211 { 212 $content .= 213 'Validate: '.get_host_url().cookie_path() 214 .'comments.php?validate='.$comm['id']; 215 } 216 pwg_mail( get_webmaster_mail_address(), '', 217 'PWG comment by '.$comm['author'], 218 $content 219 ); 220 } 196 221 } 197 222 else -
trunk/install/config.sql
r1584 r1617 27 27 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_detailed_content','true','Send detailed content for notification by mail'); 28 28 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_complementary_mail_content','','Complementary mail content for notification by mail'); 29 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_new_user','false','Send an email to the admin when a user registers'); 30 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_comment','false','Send an email to the admin when a valid comment is entered'); 31 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_comment_validation','false','Send an email to the admin when a comment requires validation'); -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r1584 r1617 82 82 $lang['Edit tags'] = 'Edit tags'; 83 83 $lang['Elements'] = 'Elements'; 84 $lang['Email admin when a new user registers'] = 'Email admin when a new user registers'; 85 $lang['Email admin when a valid comment is entered'] = 'Email admin when a valid comment is entered'; 86 $lang['Email admin when a comment requires validation'] = 'Email admin when a comment requires validation'; 84 87 $lang['Empty caddie'] = 'Empty caddie'; 85 88 $lang['Environment'] = 'Environment'; -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r1584 r1617 82 82 $lang['Edit tags'] = 'Editer les tags'; 83 83 $lang['Elements'] = 'Éléments'; 84 $lang['Email admin when a new user registers'] = 'Notifier le webmestre lors de l\'inscription d\'un utilisateur'; 85 $lang['Email admin when a valid comment is entered'] = 'Notifier le webmestre quand un commentaire est enregistré'; 86 $lang['Email admin when a comment requires validation'] = 'Notifier le webmestre quand un commentaire requiert sa validation'; 84 87 $lang['Empty caddie'] = 'Vider le panier'; 85 88 $lang['Environment'] = 'Environnement'; -
trunk/template/yoga/admin/configuration.tpl
r1565 r1617 54 54 55 55 <li> 56 <label> 57 <span class="property">{lang:Email admin when a new user registers}</span> 58 <input type="checkbox" name="email_admin_on_new_user" {general.EMAIL_ADMIN_ON_NEW_USER} /> 59 </label> 60 </li> 61 62 <br/> 63 <li> 56 64 <fieldset> 57 65 <legend>{lang:History}</legend> 58 66 <ul> 59 67 <li> 60 <label><span class="property">{lang:Users}</span><input type="checkbox" name="log" {general. HISTORY_USERS} /></label>68 <label><span class="property">{lang:Users}</span><input type="checkbox" name="log" {general.LOG} /></label> 61 69 </li> 62 70 … … 85 93 <ul> 86 94 <li> 87 <span class="property">{lang:Comments for all}</span> 88 <label><input type="radio" class="radio" name="comments_forall" value="true" {comments.COMMENTS_ALL_YES} />{lang:Yes}</label> 89 <label><input type="radio" class="radio" name="comments_forall" value="false" {comments.COMMENTS_ALL_NO} />{lang:No}</label> 95 <label> 96 <span class="property">{lang:Comments for all}</span> 97 <input type="checkbox" name="comments_forall" {comments.COMMENTS_FORALL} /> 98 </label> 90 99 </li> 91 100 … … 98 107 99 108 <li> 100 <span class="property">{lang:Validation}</span> 101 <label><input type="radio" class="radio" name="comments_validation" value="true" {comments.VALIDATE_YES} />{lang:Yes}</label> 102 <label><input type="radio" class="radio" name="comments_validation" value="false" {comments.VALIDATE_NO} />{lang:No}</label> 103 </li> 109 <label> 110 <span class="property">{lang:Validation}</span> 111 <input type="checkbox" name="comments_validation" {comments.COMMENTS_VALIDATION} /> 112 </label> 113 </li> 114 115 116 <li> 117 <label> 118 <span class="property">{lang:Email admin when a valid comment is entered}</span> 119 <input type="checkbox" name="email_admin_on_comment" {comments.EMAIL_ADMIN_ON_COMMENT} /> 120 </label> 121 </li> 122 123 <li> 124 <label> 125 <span class="property">{lang:Email admin when a comment requires validation}</span> 126 <input type="checkbox" name="email_admin_on_comment_validation" {comments.EMAIL_ADMIN_ON_COMMENT_VALIDATION} /> 127 </label> 128 </li> 129 104 130 </ul> 105 131 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.