コード例 #1
0
ファイル: update.class.php プロジェクト: arimanr/userprofile2
 /** {@inheritDoc} */
 public function initialize()
 {
     if (!$this->modx->hasPermission($this->permission)) {
         return $this->modx->lexicon('access_denied');
     }
     $this->userprofile2 = $this->modx->userprofile2;
     $this->userprofile2->initialize($this->modx->context->key);
     $this->config = $this->userprofile2->config;
     // get data
     $data = $this->getProperty('data');
     if (empty($data)) {
         return $this->success();
     }
     $data = $this->modx->fromJSON($data);
     if (!($this->type = $data['type'])) {
         echo $this->userprofile2->error('up2_type_profile_err');
         exit;
     }
     // get properties
     if (isset($data['form_key'])) {
         $formKey = $data['form_key'];
     }
     if (!empty($formKey) && isset($_SESSION['up2form'][$formKey])) {
         $this->config = array_merge($this->config, $_SESSION['up2form'][$formKey]);
     }
     $this->ctx = $this->config['ctx'];
     return parent::initialize();
 }
コード例 #2
0
ファイル: update.class.php プロジェクト: arimanr/userprofile2
 /** {@inheritDoc} */
 public function initialize()
 {
     if (!$this->modx->hasPermission($this->permission)) {
         return $this->modx->lexicon('access_denied');
     }
     return parent::initialize();
 }
コード例 #3
0
 public function initialize()
 {
     if (!$this->getProperty('username')) {
         return 'Не указан пользователь';
     }
     return parent::initialize();
 }
コード例 #4
0
ファイル: update.class.php プロジェクト: vgrish/mlmsystem
 /** {@inheritDoc} */
 public function initialize()
 {
     /** @var mlmsystem $mlmsystem */
     $this->MlmSystem = $this->modx->getService('mlmsystem');
     $this->MlmSystem->initialize($this->getProperty('context', $this->modx->context->key));
     return parent::initialize();
 }
コード例 #5
0
ファイル: update.class.php プロジェクト: bendasvadim/ePochta
 public function initialize()
 {
     $user_code = $this->getProperty('user_code');
     //check if code not empty
     if (empty($user_code) or $user_code == '') {
         return $this->modx->lexicon('ep_sms_code_is_empty');
     }
     $query = $this->modx->newQuery('epValidateNum');
     /*get row with select all from max row with max createdon  */
     $query->select('id as id,createdon as createdon,code as code,validate as validate,phone as phone');
     $query->limit(1);
     $query->sortby('createdon', 'desc');
     $query->where(array('user_id:=' => $this->modx->user->id));
     //get data array
     if ($query->prepare() && $query->stmt->execute()) {
         $this->data = $query->stmt->fetch(PDO::FETCH_ASSOC);
     }
     //check for current code validate status for this user
     if ($this->data['validate'] == 1) {
         return $this->modx->lexicon('ep_sms_validate_already_done');
     }
     //if code is correct - set update time and validate status
     if ($this->data['code'] == $user_code) {
         $this->setProperties(array('validate' => 1, 'updatedon' => date('Y-m-d H:i:s'), 'id' => $this->data['id']));
     } else {
         return $this->modx->lexicon('ep_sms_check_code_wrong');
     }
     return parent::initialize();
 }
コード例 #6
0
 public function initialize()
 {
     // Sanitize post data
     $this->unsetProperty('comments_count');
     //$this->unsetProperty('createdon');
     $this->unsetProperty('editedon');
     if (!($thread_id = (int) $this->getProperty('thread_id'))) {
         /*
             Если не была получена ветка, то пытаемся ее создать
         */
         if (!($response = $this->modx->runProcessor('society/web/threads/get', array("target_id" => $this->getProperty("target_id"), "target_class" => $this->getProperty("target_class", "modResource")), array("processors_path" => dirname(dirname(dirname(dirname(__FILE__)))) . '/')))) {
             $error = "Ошибка выполнения запроса";
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -]  {$error}");
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] " . print_r($this->getProperties(), true));
             return $error;
         }
         // else
         if ($response->isError() or !($thread_data = $response->getObject())) {
             if (!($error = $response->getMessage())) {
                 $error = "Не были получены данные ветви диалога";
             }
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -]  {$error}");
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] " . print_r($response->getResponse(), true));
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] " . print_r($this->getProperties(), true));
             return $error;
         }
         //else
         $thread_id = $thread_data['id'];
     }
     $this->setProperty('id', $thread_id);
     return parent::initialize();
 }
コード例 #7
0
 public function initialize()
 {
     if (!(int) $this->getProperty('id')) {
         return "Не был получен id документа";
     }
     return parent::initialize();
 }
コード例 #8
0
ファイル: update.class.php プロジェクト: Tramp1357/wood
 public function initialize()
 {
     if (!($id = (int) $this->getProperty('order_id'))) {
         return 'Не был получен ID заявки';
     }
     $this->setProperty('id', $id);
     return parent::initialize();
 }
コード例 #9
0
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $name = $this->getProperty('name');
     if (empty($name)) {
         $this->addFieldError('name', $this->modx->lexicon('virtunewsletter.category_err_ns_name'));
     }
     return parent::initialize();
 }
コード例 #10
0
ファイル: update.class.php プロジェクト: jolichter/modxTalks
 public function initialize()
 {
     $data = $this->getProperty('data');
     if ($data = $this->modx->fromJSON($data)) {
         $this->properties = $data;
     }
     return parent::initialize();
 }
コード例 #11
0
ファイル: update.class.php プロジェクト: Tramp1357/wood
 public function initialize()
 {
     if (!($order_id = (int) $this->getProperty('order_id'))) {
         return 'Не был указан ID заказа';
     }
     // else
     $this->setProperty('id', $order_id);
     return parent::initialize();
 }
コード例 #12
0
 public function initialize()
 {
     if (!($user_id = (int) $this->getProperty('user_id'))) {
         return "Не был получен ID пользователя";
     }
     // else
     $this->setProperty('id', $user_id);
     return parent::initialize();
 }
コード例 #13
0
ファイル: update.class.php プロジェクト: sfgoo/virtualpage
 /** {@inheritDoc} */
 public function initialize()
 {
     if (!$this->modx->hasPermission($this->permission)) {
         return $this->modx->lexicon('access_denied');
     }
     if ($Event = $this->modx->getObject('vpEvent', $this->getProperty('id'))) {
         $this->nameEvent = $Event->get('name');
     }
     return parent::initialize();
 }
コード例 #14
0
ファイル: update.class.php プロジェクト: Vitaliz/simpleCRM
 public function initialize()
 {
     $editedById = $this->getProperty('id');
     $this->modx->log(modX::LOG_LEVEL_DEBUG, 'id is: ' . $editedById);
     $this->setProperty('editedby', $editedById);
     $this->setProperty('editedby_name', $this->getUserName($editedById));
     $this->modx->log(modX::LOG_LEVEL_DEBUG, 'fullname is: ' . $this->getProperty('editedby_name'));
     $this->setEditTime();
     return parent::initialize();
 }
コード例 #15
0
 public function initialize()
 {
     if (!$this->getProperty('id')) {
         $this->addFieldError('id', "Не указан id топика");
     }
     if ($this->hasErrors()) {
         return 'Проверьте правильность заполнения данных';
     }
     return parent::initialize();
 }
コード例 #16
0
ファイル: update.class.php プロジェクト: vgrish/mlmsystem
 /** {@inheritDoc} */
 public function initialize()
 {
     if (!$this->modx->hasPermission($this->permission)) {
         return $this->modx->lexicon('access_denied');
     }
     /** @var mlmsystem $mlmsystem */
     $this->MlmSystem = $this->modx->getService('mlmsystem');
     $this->MlmSystem->initialize($this->getProperty('context', $this->modx->context->key));
     return parent::initialize();
 }
コード例 #17
0
ファイル: update.class.php プロジェクト: virtudraft/bbbx
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $name = $this->getProperty('name', false);
     if (empty($name)) {
         return $this->modx->lexicon('bbbx.meeting_err_ns_name');
     }
     $this->unsetProperty('action');
     $this->setProperty('edited_on', time());
     $this->setProperty('edited_by', $this->modx->user->get('id'));
     return parent::initialize();
 }
コード例 #18
0
ファイル: update.class.php プロジェクト: virtudraft/bbbx
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $name = $this->getProperty('name');
     if (empty($name)) {
         return $this->modx->lexicon('bbbx.config_err_ns_name');
     }
     $configs = $this->getProperty('configs');
     if (empty($configs)) {
         return $this->modx->lexicon('bbbx.config_err_ns_configs');
     }
     $this->unsetProperty('action');
     return parent::initialize();
 }
コード例 #19
0
 public function initialize()
 {
     if (!($user_id = $this->getProperty('user_id'))) {
         return "Не указан ID пользователя";
     }
     // else
     $this->setProperty('id', $user_id);
     if (!($key = $this->getProperty('key'))) {
         return "Не указан ключ";
     }
     $this->setProperties(array("active" => 1));
     $this->setDefaultProperties(array("auto_auth" => false));
     return parent::initialize();
 }
コード例 #20
0
 public function initialize()
 {
     $data = $this->getProperty('data');
     if (empty($data)) {
         return $this->modx->lexicon('invalid_data');
     }
     $data = $this->modx->fromJSON($data);
     if (empty($data)) {
         return $this->modx->lexicon('invalid_data');
     }
     $this->setProperties($data);
     $this->unsetProperty('data');
     return parent::initialize();
 }
コード例 #21
0
ファイル: update.class.php プロジェクト: ExcaliburKG/SmartTag
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $tag = $this->getProperty('tag');
     if (empty($tag)) {
         $this->addFieldError('tag', $this->modx->lexicon('smarttag.tag_err_ns'));
         return FALSE;
     }
     $exists = $this->modx->getObject($this->classKey, array('tag:LIKE' => $tag));
     if ($exists && $exists->get('id') != $this->getProperty('id')) {
         $this->merged = $this->modx->getObject($this->classKey, $this->getProperty('id'));
         $this->setProperty('id', $exists->get('id'));
     }
     return parent::initialize();
 }
コード例 #22
0
 public function initialize()
 {
     $props = $this->getProperties();
     $properties = array();
     foreach ($props as $k => $v) {
         if (!preg_match('/^property_/', $k)) {
             continue;
         }
         $properties[preg_replace('/^property_/', '', $k)] = $v;
         $this->unsetProperty($k);
     }
     $this->setProperty('properties', json_encode($properties));
     return parent::initialize();
 }
コード例 #23
0
ファイル: restore.class.php プロジェクト: jolichter/modxTalks
 public function initialize()
 {
     /**
      * Check context
      */
     $this->context = trim($this->getProperty('ctx'));
     if (empty($this->context)) {
         $this->failure($this->modx->lexicon('modxtalks.empty_context'));
         return false;
     } elseif (!$this->modx->getCount('modContext', $this->context)) {
         $this->failure($this->modx->lexicon('modxtalks.bad_context'));
         return false;
     }
     return parent::initialize();
 }
コード例 #24
0
ファイル: update.class.php プロジェクト: virtudraft/bbbx
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $this->unsetProperty('action');
     $meetingId = intval($this->getProperty('meeting_id'));
     if (empty($meetingId)) {
         return $this->modx->lexicon('bbbx.join_err_ns_meeting_id');
     }
     $classKey = $this->getProperty('classkey');
     if (empty($classKey)) {
         return $this->modx->lexicon('bbbx.join_err_ns_class_key');
     }
     $objectId = intval($this->getProperty('object_id'));
     if (empty($objectId)) {
         return $this->modx->lexicon('bbbx.join_err_ns_object_id');
     }
     return parent::initialize();
 }
コード例 #25
0
 public function initialize()
 {
     // Sanitize post data
     $this->unsetProperty('thread_id');
     $this->unsetProperty('parent');
     $this->unsetProperty('ip');
     $this->unsetProperty('createdon');
     $this->unsetProperty('createdby');
     $this->unsetProperty('editedon');
     $this->unsetProperty('editedby');
     $this->unsetProperty('deletedon');
     $this->unsetProperty('deletedby');
     $this->unsetProperty('comments_count');
     $this->unsetProperty('properties');
     if (!($comment_id = (int) $this->getProperty('comment_id'))) {
         return 'Не был получен ID комментария';
     }
     $this->setProperty('id', $comment_id);
     return parent::initialize();
 }
コード例 #26
0
ファイル: update.class.php プロジェクト: Tramp1357/wood
 public function initialize()
 {
     // Поиск может быть как по id, так и по связке Заказ-Товар
     // Дело в том, что Заказ-Товар и есть по сути первичный ключ, но ввиду
     // Некоторых тонкостей работы xPDO, был сохранен id в качестве первичного ключа
     // Если не указан ID, но указаны order_id и product_id,
     // То выполняем поиск этого объекта по этим данным
     if (!($order_product_id = (int) $this->getProperty('order_product_id'))) {
         if ($order_id = (int) $this->getProperty('order_id') and $product_id = (int) $this->getProperty('product_id') and $object = $this->modx->getObject($this->classKey, array('order_id' => $order_id, 'product_id' => $product_id))) {
             // Если объект был найден, устанавливаем значение ID
             $order_product_id = $object->get('id');
         }
     }
     // Проверяем наличие актуального ключа
     if (!$order_product_id) {
         return 'Не был получен ID записи Заказ-Товар';
     }
     //else
     $this->setProperty('id', $order_product_id);
     return parent::initialize();
 }
コード例 #27
0
 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function initialize()
 {
     $initialized = parent::initialize();
     if ($initialized) {
         $name = str_replace($this->modx->config['table_prefix'], '', $this->object->get('name'));
         $package = $this->getProperty('package');
         if (empty($package)) {
             return $this->modx->lexicon('dbadmin_no_package');
         }
         if (strpos($package, 'modx') !== false) {
             $schemaFile = MODX_CORE_PATH . 'model/schema/modx.mysql.schema.xml';
         } else {
             $schemaFile = MODX_CORE_PATH . 'components/' . $package . '/model/schema/' . $package . '.mysql.schema.xml';
         }
         if (!is_file($schemaFile)) {
             $schemaFile = MODX_CORE_PATH . 'components/' . $package . '/model/' . $package . '/' . $package . '.mysql.schema.xml';
         }
         if (is_file($schemaFile)) {
             $schema = new SimpleXMLElement($schemaFile, 0, true);
             if (isset($schema->object)) {
                 foreach ($schema->object as $object) {
                     if ($table = (string) $object['table']) {
                         if ($table != $name) {
                             continue;
                         }
                         $this->setProperty('class', (string) $object['class']);
                     }
                 }
             }
             unset($schema);
         } else {
             return $this->modx->lexicon('dbadmin_table_err_path');
         }
     }
     return $initialized;
 }
コード例 #28
0
 public function initialize()
 {
     $this->setDefaultProperties(array('class_key' => $this->classKey));
     $this->classKey = $this->getProperty('class_key');
     return parent::initialize();
 }
コード例 #29
0
 public function initialize()
 {
     $this->setProperty('display', 'default');
     return parent::initialize();
 }
コード例 #30
0
 public function initialize()
 {
     $this->modx->getParser();
     return parent::initialize();
 }