Changeset 1567 for trunk/include/functions_user.inc.php
- Timestamp:
- Oct 19, 2006, 11:53:18 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r1527 r1567 459 459 $status = 'normal'; 460 460 } 461 461 462 462 $insert = 463 463 array( … … 523 523 global $user, $conf; 524 524 525 $directories = 526 array( 527 PHPWG_ROOT_PATH.'language/'.$user['language'], 528 PHPWG_ROOT_PATH.'language/'.$conf['default_language'], 529 PHPWG_ROOT_PATH.'language/'.PHPWG_DEFAULT_LANGUAGE 530 ); 525 $directories = array(); 526 if ( isset($user['language']) ) 527 { 528 $directories[] = PHPWG_ROOT_PATH.'language/'.$user['language']; 529 } 530 $directories[] = PHPWG_ROOT_PATH.'language/'.$conf['default_language']; 531 $directories[] = PHPWG_ROOT_PATH.'language/'.PHPWG_DEFAULT_LANGUAGE; 531 532 532 533 foreach ($directories as $directory) … … 557 558 // search for an existing auto_login_key 558 559 $query = ' 559 SELECT auto_login_key 560 SELECT auto_login_key 560 561 FROM '.USERS_TABLE.' 561 562 WHERE '.$conf['user_fields']['id'].' = '.$user_id.' 562 563 ;'; 563 564 564 565 $auto_login_key = current(mysql_fetch_assoc(pwg_query($query))); 565 if (empty($auto_login_key)) 566 if (empty($auto_login_key)) 566 567 { 567 568 $auto_login_key = base64_encode(md5(uniqid(rand(), true))); … … 575 576 $cookie = array('id' => $user_id, 'key' => $auto_login_key); 576 577 setcookie($conf['remember_me_name'], 577 serialize($cookie), 578 serialize($cookie), 578 579 time()+$conf['remember_me_length'], 579 580 cookie_path() … … 591 592 * @return void 592 593 */ 593 function auto_login() { 594 function auto_login() { 594 595 global $conf; 595 596 … … 613 614 setcookie($conf['remember_me_name'], '', 0, cookie_path()); 614 615 redirect(make_index_url()); 615 } 616 } 616 617 } 617 618
Note: See TracChangeset
for help on using the changeset viewer.