public static function changeAccount($iAccountId) { //TODO:check if the user has access to change to that account //change account id in session to $iAccountId $_SESSION['account_id'] = $iAccountId; $_SESSION['account_domain'] = YASE_Account::getDomain($_SESSION['account_id']); }
static function login($sLogin, $sPassword) { $res = mysql_query("SELECT login from user where login='******' and password='******'"); $row = mysql_fetch_row($res); $sLoggedIn = $row[0]; if (isset($sLoggedIn)) { $_SESSION['login'] = $sLoggedIn; $_SESSION['user_id'] = YASE_User::getId($_REQUEST['username']); $_SESSION['account_id'] = YASE_User::getFirstAccountId(); $_SESSION['account_domain'] = YASE_Account::getDomain($_SESSION['account_id']); return true; } else { return false; } }
<?php require_once 'classes/YASE/Framework.php'; $id = YASE_User::getId("pedant.dk"); $_SESSION['user_id'] = $id; $aid = YASE_User::getFirstAccountId($id); print_r(YASE_Account::getDomain($aid) . "\r\n");
<?php require_once "../classes/YASE/Framework.php"; require_once "../classes/Template.php"; Template::admintop(); $iAccountID = $_REQUEST['account_id']; if (isset($iAccountID)) { YASE_Account::changeAccount($iAccountID); } ?> <br> <H1> Account information </H1> <br><br> account id:[<?php print $_SESSION["account_domain"]; ?> ] <?php print "[" . $_SESSION["account_id"] . "]"; Template::bottom(); ?>
<?php require_once '../classes/YASE/Framework.php'; $account = $argv[1]; if ($argv[1] == "") { print "usage:\r\n"; print " job.php [account name] \r\n"; exit - 1; } $iAccountID = YASE_Account::getId($argv[1]); $c = new YASE_Crawler($iAccountID); $c->start(); $i = new YASE_Indexer($iAccountID); $i->start();