- Timestamp:
- Oct 19, 2006, 2:41:07 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r1250 r1565 47 47 $page['section'] = $_GET['section']; 48 48 } 49 //------------------------------------------------------ $conf reinitialization50 $result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE);51 while ($row = mysql_fetch_array($result))52 {53 $conf[$row['param']] = $row['value'];54 // if the parameter is present in $_POST array (if a form is submited), we55 // override it with the submited value56 if (isset($_POST[$row['param']]))57 {58 $conf[$row['param']] = $_POST[$row['param']];59 if ( 'page_banner'==$row['param'] )60 { // should we do it for all ?61 $conf[$row['param']] = stripslashes( $conf[$row['param']] );62 }63 }64 }65 49 //------------------------------ verification and registration of modifications 66 50 if (isset($_POST['submit'])) … … 75 59 array_push($page['errors'], $lang['conf_gallery_url_error']); 76 60 } 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 65 break; 78 66 } … … 120 108 if (count($page['errors']) == 0) 121 109 { 122 //echo '<pre>'; print_r($_POST); echo '</pre>';110 //echo '<pre>'; print_r($_POST); echo '</pre>'; 123 111 $result = pwg_query('SELECT * FROM '.CONFIG_TABLE); 124 112 while ($row = mysql_fetch_array($result)) … … 148 136 } 149 137 138 //------------------------------------------------------ $conf reinitialization 139 $result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE); 140 while ($row = mysql_fetch_array($result)) 141 { 142 $conf[$row['param']] = $row['value']; 143 } 144 150 145 //----------------------------------------------------- template initialization 151 146 $template->set_filenames( array('config'=>'admin/configuration.tpl') ); … … 172 167 $html_check='checked="checked"'; 173 168 174 $history_yes = ($conf['log']=='true')?'checked="checked"':'';175 $history_no = ($conf['log']=='false')?'checked="checked"':'';176 169 $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':''; 177 170 $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:''; 178 175 179 176 $template->assign_block_vars( 180 177 'general', 181 178 array( 182 'HISTORY_YES'=>$history_yes, 183 'HISTORY_NO'=>$history_no, 179 'HISTORY_USERS'=>$history_users, 180 'HISTORY_ADMIN'=>$history_admin, 181 'HISTORY_GUEST'=>$history_guest, 182 'LOGIN_HISTORY'=>$login_history, 184 183 'GALLERY_LOCKED_YES'=>$lock_yes, 185 184 'GALLERY_LOCKED_NO'=>$lock_no, -
trunk/identification.php
r1511 r1565 65 65 } 66 66 log_user($row['id'], $remember_me); 67 pwg_log_login( $username ); 67 68 redirect(empty($redirect_to) ? make_index_url() : $redirect_to); 68 69 } -
trunk/include/config_default.inc.php
r1537 r1565 431 431 $conf['nb_logs_page'] = 300; 432 432 433 // history_admin : history admin visits ?434 $conf['history_admin'] = false;435 436 433 // +-----------------------------------------------------------------------+ 437 434 // | urls | -
trunk/include/functions.inc.php
r1510 r1565 385 385 global $conf, $user; 386 386 387 if ($conf['log']) 388 { 389 if (($conf['history_admin']) or ((! $conf['history_admin']) 390 and (!is_admin()))) 391 { 387 if ( is_admin() ) 388 { 389 $doit=$conf['history_admin']; 390 } 391 elseif ( $user['is_the_guest'] ) 392 { 393 $doit=$conf['history_guest']; 394 } 395 else 396 { 397 $doit = $conf['log']; 398 } 399 400 if ($doit) 401 { 392 402 $login = ($user['id'] == $conf['guest_id']) 393 403 ? 'guest' : addslashes($user['username']); 394 395 $query = ' 404 insert_into_history($login, $file, $category, $picture); 405 } 406 } 407 408 function pwg_log_login( $username ) 409 { 410 global $conf; 411 if ( $conf['login_history'] ) 412 { 413 insert_into_history($username, 'login', '', ''); 414 } 415 } 416 417 // inserts a row in the history table 418 function insert_into_history( $login, $file, $category, $picture) 419 { 420 $query = ' 396 421 INSERT INTO '.HISTORY_TABLE.' 397 422 (date,login,IP,file,category,picture) … … 404 429 \''.addslashes($picture).'\') 405 430 ;'; 406 pwg_query($query); 407 } 408 } 431 pwg_query($query); 409 432 } 410 433 … … 462 485 } 463 486 464 function pwg_stripslashes($value) 487 function pwg_stripslashes($value) 465 488 { 466 489 if (get_magic_quotes_gpc()) … … 471 494 } 472 495 473 function pwg_addslashes($value) 496 function pwg_addslashes($value) 474 497 { 475 498 if (!get_magic_quotes_gpc()) … … 480 503 } 481 504 482 function pwg_quotemeta($value) 505 function pwg_quotemeta($value) 483 506 { 484 507 if (get_magic_quotes_gpc()) { … … 700 723 { 701 724 global $conf; 702 725 703 726 $error = '<pre>'; 704 727 $error.= $header; … … 945 968 { 946 969 global $conf; 947 970 948 971 $query = ' 949 972 SELECT param,value … … 960 983 { 961 984 $conf[ $row['param'] ] = isset($row['value']) ? $row['value'] : ''; 962 985 963 986 // If the field is true or false, the variable is transformed into a 964 987 // boolean value. -
trunk/install/config.sql
r1417 r1565 20 20 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('rate_anonymous','true','Rating pictures feature is also enabled for visitors'); 21 21 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('page_banner','<h1>PhpWebGallery demonstration site</h1><p>My photos web site</p>','html displayed on the top each page of your gallery'); 22 22 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('history_admin','false','keep a history of administrator visits on your website'); 23 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('history_guest','true','keep a history of guest visits on your website'); 24 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('login_history','true','keep a history of user logins on your website'); 23 25 -- Notification by mail 24 26 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nbm_send_mail_as','','Send mail as param value for notification by mail'); -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r1538 r1565 100 100 $lang['Linked categories'] = 'Linked categories'; 101 101 $lang['Lock gallery'] = 'Lock gallery'; 102 $lang['Login history'] = 'User login history'; 102 103 $lang['Maintenance'] = 'Maintenance'; 103 104 $lang['Manage permissions for a category'] = 'Manage permissions for a category'; -
trunk/language/en_UK.iso-8859-1/help/configuration.html
r1071 r1565 22 22 <li><strong>Gallery URL</strong>: used for the RSS feed.</li> 23 23 24 <li><strong>History</strong>: visits on pages <span25 class="pwgScreen">category.php</span> and <span26 class="pwgScreen">picture.php</span> will be registered in27 <code>history</code> table. Visits will be shown in <span28 class="pwgScreen">Administration, General, History</span>.</li>29 30 24 <li><strong>Lock gallery</strong>: Lock the entire gallery for 31 25 maintenance. Only administrator users will be able to reach the … … 36 30 <li><strong>Rating by guests</strong>: Even non registered users can 37 31 rate images.</li> 32 33 <li><strong>History Users</strong>: visits by registrered users on pages <span 34 class="pwgScreen">category.php</span> and <span 35 class="pwgScreen">picture.php</span> will be saved in the 36 <code>history</code> table. Visits will be shown in <span 37 class="pwgScreen">Administration, General, History</span>.</li> 38 39 <li><strong>History Administrator</strong>: page visits by administrators 40 will be saved.</li> 41 42 <li><strong>History Guests</strong>: page visits by guests will be saved.</li> 43 44 <li><strong>User login history</strong>: when a user logs in, it will be 45 logged in the <code>history</code> table.</li> 38 46 39 47 </ul> -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r1538 r1565 100 100 $lang['Linked categories'] = 'Catégories associées'; 101 101 $lang['Lock gallery'] = 'Verrouiller la galerie'; 102 $lang['Login history'] = 'Historique des connexions'; 102 103 $lang['Maintenance'] = 'Maintenance'; 103 104 $lang['Manage permissions for a category'] = 'Gérer les permissions pour une catégorie'; -
trunk/language/fr_FR.iso-8859-1/help/configuration.html
r1099 r1565 22 22 <li><strong>URL de la galerie</strong>: utilisé pour le flux RSS.</li> 23 23 24 <li><strong>Historique</strong>: visites des pages <span25 class="pwgScreen">category.php</span> et <span26 class="pwgScreen">picture.php</span> sont enregistrées dans la table27 <code>history</code>. Les visites sont affichées dans l'écran <span28 class="pwgScreen">Administration, Général, Historique</span>.</li>29 30 24 <li><strong>Verrouiller la galerie</strong>: Verrouiller l'ensemble de la 31 25 galerie pour maintenance. Seul les administrateurs pourront accéder à la … … 36 30 <li><strong>Notation par les visiteurs</strong>: Même les utilisateurs 37 31 non enregistrés peuvent noter les images.</li> 32 33 <li><strong>Historique Utilisateurs</strong>: les visites des pages <span 34 class="pwgScreen">index.php</span> et <span 35 class="pwgScreen">picture.php</span> par les utilisateurs enregistrés sont 36 enregistrées dans la table <code>history</code>. Les visites sont affichées 37 dans l'écran <span class="pwgScreen">Administration, Général, Historique</span>.</li> 38 39 <li><strong>Historique Administrateur</strong>: les visites des pages 40 par les administrateurs sont enregistrées.</li> 41 42 <li><strong>Historique Invités</strong>: les visites des pages 43 par les invités sont enregistrées.</li> 44 45 <li><strong>Historique des connexions</strong>: chaque connexion 46 utilisateur, est enregistrée dans la table <code>history</code>.</li> 38 47 39 48 </ul> -
trunk/register.php
r1082 r1565 49 49 { 50 50 $user_id = get_userid($_POST['login']); 51 log_user( $user_id, false);52 51 redirect(make_index_url()); 53 52 } -
trunk/template/yoga/admin/configuration.tpl
r1491 r1565 36 36 37 37 <li> 38 <span class="property">{lang:History}</span>39 <label><input type="radio" class="radio" name="log" value="true" {general.HISTORY_YES} />{lang:Yes}</label>40 <label><input type="radio" class="radio" name="log" value="false" {general.HISTORY_NO} />{lang:No}</label>41 </li>42 43 <li>44 38 <span class="property">{lang:Lock gallery}</span> 45 39 <label><input type="radio" class="radio" name="gallery_locked" value="true" {general.GALLERY_LOCKED_YES} />{lang:Yes}</label> 46 40 <label><input type="radio" class="radio" name="gallery_locked" value="false" {general.GALLERY_LOCKED_NO} />{lang:No}</label> 47 41 </li> 48 42 49 43 <li> 50 44 <span class="property">{lang:Rating}</span> … … 57 51 <label><input type="radio" class="radio" name="rate_anonymous" value="true" {general.RATE_ANONYMOUS_YES} />{lang:Yes}</label> 58 52 <label><input type="radio" class="radio" name="rate_anonymous" value="false" {general.RATE_ANONYMOUS_NO} />{lang:No}</label> 53 </li> 54 55 <li> 56 <fieldset> 57 <legend>{lang:History}</legend> 58 <ul> 59 <li> 60 <label><span class="property">{lang:Users}</span><input type="checkbox" name="log" {general.HISTORY_USERS} /></label> 61 </li> 62 63 <li> 64 <label><span class="property">{lang:user_status_admin}</span><input type="checkbox" name="history_admin" {general.HISTORY_ADMIN} /></label> 65 </li> 66 67 <li> 68 <label><span class="property">{lang:Guests}</span><input type="checkbox" name="history_guest" {general.HISTORY_GUEST} /></label> 69 </li> 70 71 <li> 72 <label><span class="property">{lang:Login history}</span><input type="checkbox" name="login_history" {general.LOGIN_HISTORY} /></label> 73 </li> 74 </ul> 75 </fieldset> 59 76 </li> 60 77 </ul>
Note: See TracChangeset
for help on using the changeset viewer.