<?php
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// WebSite: http://www.rvglobalsoft.com
// Unauthorized copying is strictly forbidden and may result in severe legal action.
// Copyright (c) 2006 RV Global Soft Co.,Ltd. All rights reserved.
//
// =====YOU MUST KEEP THIS COPYRIGHTS NOTICE INTACT AND CAN NOT BE REMOVE =======
// Copyright (c) 2006 RV Global Soft Co.,Ltd. All rights reserved.
// This Agreement is a legal contract, which specifies the terms of the license
// and warranty limitation between you and RV Global Soft Co.,Ltd. and RV Site Builder.
// You should carefully read the following terms and conditions before
// installing or using this software. Unless you have a different license
// agreement obtained from RV Global Soft Co.,Ltd., installation or use of this software
// indicates your acceptance of the license and warranty limitation terms
// contained in this Agreement. If you do not agree to the terms of this
// Agreement, promptly delete and destroy all copies of the Software.
//
// ===== Grant of License =======
// The Software may only be installed and used on a single host machine.
//
// ===== Disclaimer of Warranty =======
// THIS SOFTWARE AND ACCOMPANYING DOCUMENTATION ARE PROVIDED "AS IS" AND
// WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER
// WARRANTIES WHETHER EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS HARDWARE
// AND SOFTWARE ENVIRONMENTS INTO WHICH RV SITE BUILDER MAY BE USED, NO WARRANTY OF
// FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. THE USER MUST ASSUME THE
// ENTIRE RISK OF USING THIS PROGRAM. ANY LIABILITY OF RV GLOBAL SOFT CO.,LTD. WILL BE
// LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.
// IN NO CASE SHALL RV GLOBAL SOFT CO.,LTD. BE LIABLE FOR ANY INCIDENTAL, SPECIAL OR
// CONSEQUENTIAL DAMAGES OR LOSS, INCLUDING, WITHOUT LIMITATION, LOST PROFITS
// OR THE INABILITY TO USE EQUIPMENT OR ACCESS DATA, WHETHER SUCH DAMAGES ARE
// BASED UPON A BREACH OF EXPRESS OR IMPLIED WARRANTIES, BREACH OF CONTRACT,
// NEGLIGENCE, STRICT TORT, OR ANY OTHER LEGAL THEORY. THIS IS TRUE EVEN IF
// RV GLOBAL SOFT CO.,LTD. IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO CASE WILL
// RV GLOBAL SOFT CO.,LTD.'S LIABILITY EXCEED THE AMOUNT OF THE LICENSE FEE ACTUALLY PAID
// BY LICENSEE TO RV GLOBAL SOFT CO.,LTD.
// +---------------------------------------------------------------------------+
// | ChangeExpiredMgr.php |
// +---------------------------------------------------------------------------+
// | Author: Thiraphat Somcharit <thiraphat@rvglobalsoft.com> |
// +---------------------------------------------------------------------------+
// $Id: ChangeExpiredMgr.php,v 1.1 2006/07/20 02:15:02 thiraphat Exp $
require_once SGL_MOD_DIR . '/default/classes/DefaultDAO.php';
require_once SGL_MOD_DIR . '/user/classes/UserDAO.php';
require_once SGL_MOD_DIR . '/user/classes/encrype.php';
require_once SGL_CORE_DIR . '/Delegator.php';
require_once 'Validate.php';
class ChangeExpiredMgr extends SGL_Manager
{
function ChangeExpiredMgr()
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
parent::SGL_Manager();
$this->pageTitle = 'User Manager' . ' :: Change Expired Date';
$this->template = 'userExpiredChange.html';
$this->masterTemplate = 'masterMinimal.html';
$daUser = UserDAO::singleton();
$daDefault = DefaultDAO::singleton();
$this->da = new SGL_Delegator();
$this->da->add($daUser);
$this->da->add($daDefault);
$this->_aActionsMapping = array(
'list' => array('list'),
'update' => array('update'),
);
}
function validate($req, &$input)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$this->validated = true;
$input->error = array();
$input->pageTitle = $this->pageTitle;
$input->masterTemplate = $this->masterTemplate;
$input->template = $this->template;
$input->action = ($req->get('action')) ? $req->get('action') : 'list';
$input->user_id = $req->get('frmUserID');
$input->dateExpired = $req->get('frmUserExpired');
$aDateExpired = explode('/', $input->dateExpired);
$time = @strftime('%T', time());
$input->dateExpired = $aDateExpired[2] . '-' . $aDateExpired[0] . '-' . $aDateExpired[1] . ' ' . $time;
//print_r($aDateExpired);
$input->isExpired = $req->get('frmIsExpired');
$input->unExpire = $req->get('unExpire');
// if errors have occured
if (isset($aErrors) && count($aErrors)) {
SGL::raiseMsg('Please fill in the indicated fields');
$input->error = $aErrors;
$this->validated = false;
}
}
function _cmd_list($input, &$output)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$oUser = $this->da->getUserById($input->user_id);
$output->user = $oUser;
}
function _cmd_update(&$input, &$output)
{
if ($input->isExpired == 0) {
$input->dateExpired = 0;
$output->unExpire = true;
} else {
unset($output->unExpire);
}
$query = "UPDATE {$this->conf['table']['user']}
SET user_expire = '{$input->dateExpired}'
WHERE usr_id = {$input->user_id}";
if (is_a($this->dbh->query($query), 'PEAR_Error')) {
SGL::raiseError('There was a problem modifying the record',
SGL_ERROR_NOAFFECTEDROWS);
} else {
SGL::raiseMsg('Expired changed successfully', true, SGL_MESSAGE_INFO);
}
$this->_cmd_redirectToMyAccount($input, $output);
}
function _cmd_redirectToMyAccount(&$input, &$output)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$aRedir = array(
'moduleName' => 'user',
'managerName' => 'user'
);
SGL_HTTP::redirect($aRedir);
}
}
?>
Copyright 2K16 - 2K18 Indonesian Hacker Rulez