<?php
/**
* XS2:
*
* This file is developed by Solutecs, LLC for the purpose of the company
* and is provided together with XS2 Framework as and inherent part of the
* system. This file can be used on the terms of License Agreement.
*
* +7 (495) 585-0833 / 13 Rusakovskaya street, Moscow 107140 Russia
*
* @link http://www.solutecs.com
* @copyright ©1998-2007 Solutecs, LLC
* @package XS2-MODCOM
* @subpackage proc-users
* @version 1.XX
*/
session_start();
if ($_POST['action'] == 'logoutUser') {
unset($_SESSION['currentUser']);
unset($GLOBALS['currentUser']);
$_HTML->assign('currentUser', NULL);
return;
}
if ($_POST['action']=='loginUser' && $_POST['Password']) {
$user = array_shift(xs2GetNodes(array('condition'=>"Login='".$_POST['Login']."' AND Password='".XSCore_PassCrypt($_POST['Password'])."'", 'NType'=>'user')));
if ($user['NodId']>0) {
$_SESSION['currentUser'] = $user;
$GLOBALS['currentUser'] = $_SESSION['currentUser'];
$_HTML->assign('currentUser', $_SESSION['currentUser']);
}
}
if ($_SESSION['currentUser']) {
$GLOBALS['currentUser'] = $_SESSION['currentUser'];
$_HTML->assign('currentUser', $_SESSION['currentUser']);
}
?>
|
|