コード例 #1
0
ファイル: IndexController.php プロジェクト: psykomo/kutump
 public function indexAction()
 {
     //$sso = new Kutu_Sso_Session();
     //$sso->start();
     $saveHandlerManager = new Kutu_Session_SaveHandler_Manager();
     $saveHandlerManager->setSaveHandler();
     Zend_Session::start();
     //$this->_helper->layout->disableLayout();
     $sReturn = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $sReturn = urlencode($sReturn);
     $this->view->returnTo = $sReturn;
     $id = Kutu_Application::getResource('identity');
     $this->view->loginUrl = $id->loginUrl;
     $this->view->logoutUrl = $id->logoutUrl;
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $username = $auth->getIdentity()->username;
         //echo $username;
     } else {
         //echo 'tidak ada';
     }
     $this->_forward('index', 'index', 'site');
 }
コード例 #2
0
ファイル: StoreController.php プロジェクト: psykomo/kutump
 function preDispatch()
 {
     $this->_helper->layout()->setLayout('layout-final-inside');
     $saveHandlerManager = new Kutu_Session_SaveHandler_Manager();
     $saveHandlerManager->setSaveHandler();
     Zend_Session::start();
     $sReturn = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $sReturn = urlencode($sReturn);
     $this->view->returnTo = $sReturn;
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->_redirect(KUTU_ROOT_URL . '/helper/sso/login' . '?returnTo=' . $sReturn);
     } else {
         // [TODO] else: check if user has access to admin page
         $username = $auth->getIdentity()->username;
         $this->view->username = $username;
     }
     $userId = $auth->getIdentity()->guid;
     $this->_userId = $userId;
     $tblUserFinance = new Kutu_Core_Orm_Table_UserFinance();
     $this->_userInfo = $tblUserFinance->find($userId)->current();
     $storeConfig = Kutu_Application::getOption('store');
     $this->_configStore = $storeConfig;
 }
コード例 #3
0
ファイル: IndexingController.php プロジェクト: psykomo/kutump
 public function reindexallcatalogAction()
 {
     $indexing = Kutu_Application::getResource('indexing');
     $indexing->reIndexAllCatalog();
 }
コード例 #4
0
ファイル: PaymentController.php プロジェクト: psykomo/kutump
 function testmodelAction()
 {
     //$mod = new App_Model_Store_Mailer();
     //$mod->testEcho();
     //$ret = Kutu_Application::getResource('jcart');
     //var_dump($ret);
     $front = Zend_Controller_Front::getInstance();
     $bootstrap = $front->getParam('bootstrap');
     $resource = $bootstrap->getPluginResource('modules');
     $moduleBootstraps = $resource->getExecutedBootstraps();
     $newsBootstrap = $moduleBootstraps['site'];
     //var_dump($newsBootstrap->getOptions());
     //var_dump($newsBootstrap->getResource('jcart'));
     $jcart = Kutu_Application::getResource('jcart1', $this->_request->getModuleName());
     var_dump($jcart);
     die;
 }
コード例 #5
0
ファイル: IndexController.php プロジェクト: psykomo/kutump
 public function testAppAction()
 {
     $resource = Kutu_Application::getResource('acl');
     var_dump($resource);
     die;
 }
コード例 #6
0
ファイル: gacl_admin.inc.php プロジェクト: psykomo/kutump
require_once "../../../baseinit.php";
require_once 'Zend/Loader.php';
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Kutu_');
$aclConfigs = Kutu_Application::getOption('resources');
Kutu_Application::getResource('session');
Zend_Session::start();
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()) {
    //$this->_redirect(KUTU_ROOT_URL.'/helper/sso/login'.'?returnTo='.$sReturn);
    die('You Must Login');
} else {
    // [TODO] else: check if user has access to admin page
    $username = $auth->getIdentity()->username;
    $acl = Kutu_Application::getResource('acl');
    if (!$acl->checkAcl("site", 'all', 'user', $username, false, false)) {
        die('You are not AUTHORIZED!');
    }
}
// phpGACL Configuration file.
if (!isset($config_file)) {
    #	$config_file = '../gacl.ini.php';
    $config_file = dirname(__FILE__) . '/../gacl.ini.php';
}
//Values supplied in $gacl_options array overwrite those in the config file.
if (file_exists($config_file)) {
    $config = parse_ini_file($config_file);
    if (is_array($config)) {
        if (isset($gacl_options)) {
            $gacl_options = array_merge($config, $gacl_options);
コード例 #7
0
ファイル: Catalog.php プロジェクト: psykomo/kutump
 public function isBoughtByUser($catalogGuid, $userId)
 {
     $db = Kutu_Application::getResource('db');
     $dbResult = $db->query("SELECT KOD.*, KO.datePurchased AS purchasingDate\n                                FROM\n                                KutuOrderDetail AS KOD,\n\t\t\t\t\t\t\t\tKutuOrder AS KO \n                                WHERE \n\t\t\t\t\t\t\t\t\tKO.orderId = KOD.orderId\n\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\tuserId = '{$userId}'\n\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t(KO.orderStatus = 3 \n\t\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\t\tKO.orderStatus = 5)\n\t\t\t\t\t\t\t\tAND \n\t\t\t\t\t\t\t\t\titemId LIKE '{$catalogGuid}'");
     //LIMIT $offset, $limit");
     $aResult = $dbResult->fetchAll(Zend_Db::FETCH_ASSOC);
     //var_dump($aResult);
     //die();
     if (count($aResult) > 0) {
         return true;
     } else {
         return false;
     }
 }
コード例 #8
0
ファイル: User.php プロジェクト: psykomo/kutump
 public function signup($aData)
 {
     $aData['isActive'] = 1;
     $today = date('Y-m-d h:i:s');
     $aData['registrationDate'] = $today;
     $aData['activationDate'] = $today;
     $aData['expirationDate'] = "2100-12-31 00:00:00";
     unset($aData['currentFund']);
     unset($aData['clientId']);
     $row = $this->save($aData);
     //Must also assign assign user as group:member_free
     $acl = Kutu_Acl::manager();
     $acl->addUserToGroup($row->username, "member_free");
     //if saving to tbl user success, then send confirmation/welcome email
     $config = new Zend_Config_Ini(KUTU_ROOT_DIR . '/application/configs/mail.ini', 'general');
     $siteOwner = "LGS Online";
     $siteName = $config->mail->sender->support->name;
     $contactEmail = $config->mail->sender->support->email;
     $message = "---------------------------------------------------------------------\nWelcome to {$siteName}\nThank you very much for signing up as a member.\n---------------------------------------------------------------------\n\nDear {$row->firstname} {$row->lastname},\n\nEveryone at {$siteOwner} welcomes you as a valuable member. You will\nnow be able to take advantage of all the features available on our\nwebsite. You will now be able to access our Legal Database. \n\nYour new user information is provided below.\n\nUsername : {$row->username}\nPassword : ****** (hidden for security purposes)\n\nYou can login to your account any time. Please visit our website and\nclick on the \"Login\" link on our home page. If you have forgotten your\npassword, you can recover it back. Goto our Login screen and click\non the \"Password Reminder\" link on the navigation bar.\n\nIf you have any questions or if you need any help, please feel free\nto e-mail us at {$contactEmail}. Thank you and welcome again\nto {$siteName}.\n\nSincerely,\n{$siteOwner} Team\nhttp://www.lgsonline.com\nDate: {$today}\n\n---------------------------------------------------------------------\nNOTE: If you have not really signed up for this account and if you\nthink that someone else has used your e-mail address, please send us\nan e-mail at support@lgsonline.com.\n--------------------------------------------------------------------- ";
     $options = array('auth' => $config->mail->auth, 'username' => $config->mail->username, 'password' => $config->mail->password);
     $transport = new Zend_Mail_Transport_Smtp($config->mail->host, $options);
     $mail = new Zend_Mail();
     $mail->setBodyText($message);
     $mail->setFrom($config->mail->sender->support->email, $config->mail->sender->support->name);
     $mail->addTo($row->email, $row->firstname . ' ' . $row->lastname);
     $mail->setSubject('Welcome to LGS Online');
     try {
         //$mail->send($transport);
         $mailTransport = Kutu_Application::getResource('mail');
         $mail->send($mailTransport);
     } catch (Zend_Exception $e) {
         //no need to do anything. The error is only about sending email.
         //maybe, we may set status in table user indicating that we never send
         // the user with welcome email.
     }
 }
コード例 #9
0
ファイル: jcart-relay.php プロジェクト: psykomo/kutump
<?php

error_reporting(E_ALL | E_STRICT);
require_once "../../baseinit.php";
//ensure resource Session has/is initialized;
//$application->getBootstrap()->bootstrap('session');
//$application->getBootstrap()->getResource('session');
//require_once("Kutu/Application.php");
Kutu_Application::getResource('session');
Kutu_Application::getResource('db');
// THIS FILE TAKES INPUT FROM AJAX REQUESTS VIA JQUERY post AND get METHODS, THEN PASSES DATA TO JCART
// RETURNS UPDATED CART HTML BACK TO SUBMITTING PAGE
// INCLUDE JCART BEFORE SESSION START
include 'jcart.php';
// START SESSION
//session_start();
Zend_Session::start();
// INITIALIZE JCART AFTER SESSION START
$cart =& $_SESSION['jCart'];
if (!is_object($cart)) {
    $cart = new jCart();
}
// PROCESS INPUT AND RETURN UPDATED CART HTML
$cart->display_cart($jcart);