Пример #1
0
 public static function execute(ApplicationAbstract $application)
 {
     if (Administrators::delete($_GET['id'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink());
 }
 public static function execute($data)
 {
     Registry::set('PDO', PDO::initialize($data['server'], $data['username'], $data['password'], $data['database'], $data['port'], $data['class']));
     OSCOM::setConfig('db_table_prefix', $data['table_prefix'], 'Admin');
     OSCOM::setConfig('db_table_prefix', $data['table_prefix'], 'Shop');
     OSCOM::setConfig('db_table_prefix', $data['table_prefix'], 'Setup');
     $cfg_data = array(array('key' => 'STORE_NAME', 'value' => $data['shop_name']), array('key' => 'STORE_OWNER', 'value' => $data['shop_owner_name']), array('key' => 'STORE_OWNER_EMAIL_ADDRESS', 'value' => $data['shop_owner_email']), array('key' => 'EMAIL_FROM', 'value' => '"' . $data['shop_owner_name'] . '" <' . $data['shop_owner_email'] . '>'));
     OSCOM::callDB('Admin\\UpdateConfigurationParameters', $cfg_data, 'Site');
     $admin_data = array('username' => $data['admin_username'], 'password' => $data['admin_password'], 'modules' => array('0'));
     Administrators::save($admin_data);
 }
Пример #3
0
 public static function execute()
 {
     if (!isset($_GET['search'])) {
         $_GET['search'] = '';
     }
     if (!isset($_GET['page']) || !is_numeric($_GET['page'])) {
         $_GET['page'] = 1;
     }
     if (!empty($_GET['search'])) {
         $result = Administrators::find($_GET['search'], $_GET['page']);
     } else {
         $result = Administrators::getAll($_GET['page']);
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }
Пример #4
0
 public static function execute(ApplicationAbstract $application)
 {
     $error = false;
     foreach ($_POST['batch'] as $id) {
         if (!Administrators::delete($id)) {
             $error = true;
             break;
         }
     }
     if ($error === false) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
Пример #5
0
 public static function execute(ApplicationAbstract $application)
 {
     $error = false;
     foreach ($_POST['batch'] as $id) {
         if (!Administrators::setAccessLevels($id, $_POST['modules'], $_POST['mode'])) {
             $error = true;
             break;
         }
     }
     if ($error === false) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
         if (in_array($_SESSION[OSCOM::getSite()]['id'], $_POST['batch'])) {
             $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
         }
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink());
 }
Пример #6
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('username' => $_POST['user_name'], 'password' => $_POST['user_password']);
     switch (Administrators::save(isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, $data, isset($_POST['modules']) ? $_POST['modules'] : null)) {
         case 1:
             if (isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id'] == $_SESSION[OSCOM::getSite()]['id']) {
                 $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_GET['id']);
             }
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
             osc_redirect_admin(OSCOM::getLink());
             break;
         case -1:
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
             osc_redirect_admin(OSCOM::getLink());
             break;
         case -2:
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_username_already_exists'), 'error');
             break;
     }
 }
Пример #7
0
<?php

/*
  osCommerce Online Merchant $osCommerce-SIG$
  Copyright (c) 2010 osCommerce (http://www.oscommerce.com)

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\Site\Admin\Application\Administrators\Administrators;
use osCommerce\OM\Core\OSCOM;
$OSCOM_ObjectInfo = new ObjectInfo(Administrators::get($_GET['id']));
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<div class="infoBox">
  <h3><?php 
echo osc_icon('trash.png') . ' ' . $OSCOM_ObjectInfo->getProtected('user_name');
?>
Пример #8
0
</option></select></p>

    <ul id="accessToModules" class="modulesListing"></ul>
  </fieldset>

  <p><?php 
echo osc_draw_button(array('priority' => 'primary', 'icon' => 'check', 'title' => OSCOM::getDef('button_save'))) . ' ' . osc_draw_button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel')));
?>
</p>

  </form>
</div>

<script type="text/javascript">
  var accessModules = <?php 
echo json_encode(Administrators::getAccessModules());
?>
;
  var deleteAccessModuleIcon = '<?php 
echo osc_icon('uninstall.png');
?>
';

  var $modulesList = $('#modulesList');

  $.each(accessModules, function(i, item) {
    var sGroup = document.createElement('optgroup');
    sGroup.label = i;

    $.each(item, function(key, value) {
      var sOption = new Option(value['text'], value['id']);