/users/change_account.php

http://showslow.googlecode.com/ · PHP · 24 lines · 20 code · 4 blank · 0 comment · 3 complexity · 7d03fb4fb02fccab9ca38d5a10842f26 MD5 · raw file

  1. <?php
  2. require_once(dirname(__FILE__).'/config.php');
  3. require_once(dirname(__FILE__).'/User.php');
  4. require_once(dirname(__FILE__).'/Account.php');
  5. $user = User::require_login();
  6. if (array_key_exists('account', $_GET)) {
  7. $account = Account::getByID($_GET['account']);
  8. if (!is_null($account))
  9. {
  10. $account->setAsCurrent($user);
  11. }
  12. }
  13. if (array_key_exists('return', $_GET)) {
  14. $return_to = $_GET['return'];
  15. }
  16. else
  17. {
  18. $return_to = UserConfig::$USERSROOTURL.'/manage_account.php';
  19. }
  20. header('Location: '.$return_to);