Changeset 1068
- Timestamp:
- Mar 7, 2006, 2:20:02 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1064 r1068 1 2 1 <?php 3 2 // +-----------------------------------------------------------------------+ … … 188 187 ;'; 189 188 pwg_query($query); 190 189 191 190 $query = ' 192 191 DELETE FROM '.GROUP_ACCESS_TABLE.' … … 206 205 207 206 $sources_of = array(); 208 207 209 208 while ($row = mysql_fetch_array($result)) 210 209 { … … 446 445 { 447 446 array_push($query_ids, $row['category_id']); 448 447 449 448 array_push( 450 449 $datas, … … 1350 1349 { 1351 1350 $images_of = array(); 1352 1351 1353 1352 $query = ' 1354 1353 SELECT category_id, image_id … … 1369 1368 ); 1370 1369 } 1371 1370 1372 1371 $fulldirs = get_fulldirs( 1373 1372 array_keys($images_of) … … 1619 1618 1620 1619 $destinations_of = array(); 1621 1620 1622 1621 while ($row = mysql_fetch_array($result)) 1623 1622 { … … 1639 1638 // let's suppose we only need a single turn 1640 1639 $need_new_turn = false; 1641 1640 1642 1641 foreach ($destinations_of as $source => $destinations) 1643 1642 { … … 1656 1655 array($source) // no cyclic link 1657 1656 ); 1658 1657 1659 1658 if (count($missing_destinations) > 0) 1660 1659 { … … 1685 1684 $filtered_destinations_of[$category] = array(); 1686 1685 } 1687 1686 1688 1687 foreach ($destinations_of as $source => $destinations) 1689 1688 { … … 1713 1712 1714 1713 $sources_of = array(); 1715 1714 1716 1715 foreach ($destinations_of as $source => $destinations) 1717 1716 { … … 1726 1725 } 1727 1726 } 1728 1727 1729 1728 // eventually, filter 1730 1729 if (is_array($categories)) … … 1738 1737 $filtered_sources_of[$category] = array(); 1739 1738 } 1740 1739 1741 1740 foreach ($sources_of as $destination => $sources) 1742 1741 { … … 1784 1783 } 1785 1784 } 1786 1785 1787 1786 $query = ' 1788 1787 SELECT image_id, category_id … … 1803 1802 1804 1803 $inserts = array(); 1805 1804 1806 1805 foreach ($sources_of as $destination => $sources) 1807 1806 { 1808 1807 // merge all images from the sources of this destination 1809 1808 $sources_images = array(); 1810 1809 1811 1810 foreach ($sources as $source) 1812 1811 { … … 1875 1874 * 1876 1875 * Warning: only virtual links can be removed, physical links are protected. 1877 * 1876 * 1878 1877 * @param int destination 1879 1878 * @param array sources … … 1894 1893 ;'; 1895 1894 pwg_query($query); 1896 1895 1897 1896 // The strategy is the following: 1898 1897 // … … 1928 1927 $destinations_of[$destination] 1929 1928 ); 1930 1929 1931 1930 // unlink sources images from destinations 1932 1931 $query = ' … … 1949 1948 1950 1949 $request_random = array(); 1951 1950 1952 1951 while ($row = mysql_fetch_array($result)) 1953 1952 { … … 1979 1978 { 1980 1979 global $conf; 1981 1980 1982 1981 // is the given category name only containing blank spaces ? 1983 1982 if (preg_match('/^\s*$/', $category_name)) … … 1985 1984 return array('error' => l10n('cat_error_name')); 1986 1985 } 1987 1986 1988 1987 $parent_id = !empty($parent_id) ? $parent_id : 'NULL'; 1989 1988 … … 1994 1993 ;'; 1995 1994 list($current_rank) = mysql_fetch_array(pwg_query($query)); 1996 1995 1997 1996 $insert = array( 1998 1997 'name' => $category_name, … … 2001 2000 'uploadable' => 'false', 2002 2001 ); 2003 2002 2004 2003 if ($parent_id != 'NULL') 2005 2004 { … … 2013 2012 $insert{'id_uppercat'} = $parent{'id'}; 2014 2013 $insert{'global_rank'} = $parent{'global_rank'}.'.'.$insert{'rank'}; 2015 2014 2016 2015 // at creation, must a category be visible or not ? Warning : if the 2017 2016 // parent category is invisible, the category is automatically create … … 2025 2024 $insert{'visible'} = $conf['newcat_default_visible']; 2026 2025 } 2027 2026 2028 2027 // at creation, must a category be public or private ? Warning : if the 2029 2028 // parent category is private, the category is automatically create … … 2067 2066 ;'; 2068 2067 pwg_query($query); 2069 2068 2070 2069 return array( 2071 2070 'info' => l10n('cat_virtual_added'), -
trunk/identification.php
r1061 r1068 57 57 if ($row['password'] == $conf['pass_convert']($_POST['password'])) 58 58 { 59 $ session_length = $conf['session_length'];59 $remember_me = false; 60 60 if ($conf['authorize_remembering'] 61 61 and isset($_POST['remember_me']) 62 62 and $_POST['remember_me'] == 1) 63 63 { 64 $ session_length = $conf['remember_me_length'];64 $remember_me = true; 65 65 } 66 session_set_cookie_params($session_length); 67 session_start(); 68 $_SESSION['id'] = $row['id']; 66 log_user( $row['id'], $remember_me); 69 67 redirect(empty($redirect_to) ? 'category.php' : $redirect_to); 70 68 } -
trunk/include/functions_user.inc.php
r1036 r1068 83 83 ;'; 84 84 list($next_id) = mysql_fetch_array(pwg_query($query)); 85 85 86 86 $insert = 87 87 array( … … 94 94 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 95 95 mass_inserts(USERS_TABLE, array_keys($insert), array($insert)); 96 96 97 97 create_user_infos($next_id); 98 98 } … … 118 118 119 119 $userdata = array(); 120 120 121 121 $query = ' 122 122 SELECT '; … … 139 139 WHERE '.$conf['user_fields']['id'].' = \''.$user_id.'\' 140 140 ;'; 141 141 142 142 $row = mysql_fetch_array(pwg_query($query)); 143 143 … … 160 160 } 161 161 } 162 162 163 163 $row = array_merge($row, mysql_fetch_array($result)); 164 164 165 165 foreach ($row as $key => $value) 166 166 { … … 195 195 ;'; 196 196 pwg_query($query); 197 197 198 198 $query = ' 199 199 INSERT INTO '.USER_CACHE_TABLE.' … … 308 308 $private_array = array_unique($private_array); 309 309 } 310 310 311 311 // retrieve category ids directly authorized to the user 312 312 $query = ' … … 341 341 // true. 342 342 array_push($forbidden_array, '-1'); 343 343 344 344 return implode(',', $forbidden_array); 345 345 } … … 354 354 { 355 355 global $conf; 356 356 357 357 $query = ' 358 358 SELECT '.$conf['user_fields']['username'].' … … 369 369 return false; 370 370 } 371 371 372 372 return $username; 373 373 } … … 434 434 { 435 435 global $conf; 436 436 437 437 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 438 438 … … 480 480 return false; 481 481 } 482 482 483 483 return $groupname; 484 484 } … … 497 497 { 498 498 global $user, $conf; 499 499 500 500 $directories = 501 501 array( … … 508 508 { 509 509 $filepath = $directory.'/'.$filename; 510 510 511 511 if (file_exists($filepath)) 512 512 { … … 514 514 } 515 515 } 516 516 517 517 return false; 518 518 } 519 520 /* 521 * Performs all required actions for user login 522 * @param int user_id 523 * @param bool remember_me 524 * @return void 525 */ 526 function log_user($user_id, $remember_me) 527 { 528 global $conf; 529 $session_length = $conf['session_length']; 530 if ($remember_me) 531 { 532 $session_length = $conf['remember_me_length']; 533 } 534 session_set_cookie_params($session_length); 535 session_start(); 536 $_SESSION['id'] = $user_id; 537 } 538 519 539 ?> -
trunk/register.php
r1004 r1068 37 37 array_push($errors, $lang['reg_err_pass']); 38 38 } 39 39 40 40 $errors = 41 41 array_merge( … … 45 45 $_POST['mail_address']) 46 46 ); 47 47 48 48 if (count($errors) == 0) 49 49 { 50 50 $user_id = get_userid($_POST['login']); 51 $session_id = session_create($user_id, $conf['session_length']); 52 $url = 'category.php?id='.$session_id; 53 redirect($url); 51 log_user( $user_id, false); 52 redirect('category.php'); 54 53 } 55 54 } … … 77 76 78 77 'U_HOME' => PHPWG_ROOT_PATH.'category.php', 79 78 80 79 'F_ACTION' => 'register.php', 81 80 'F_LOGIN' => $login,
Note: See TracChangeset
for help on using the changeset viewer.