/** * AdminUsersModel constructor. * @param $title * @param bool $isRequest * @param null $roles */ public function __construct($title, $isRequest = false, $roles = null) { parent::__construct($title); if ($isRequest) { $this->page = 1; $this->size = $_REQUEST['Size']; $this->sort = $_REQUEST['Sort']; $this->email = $_REQUEST['Email']; $this->emailConfirmed = $_REQUEST['EmailConfirmed']; $this->createdDateFrom = $_REQUEST['CreatedDateFrom'] != '' ? new \DateTime($_REQUEST['CreatedDateFrom']) : null; $this->createdDateTo = $_REQUEST['CreatedDateTo'] != '' ? new \DateTime($_REQUEST['CreatedDateTo']) : null; $this->lastLoginDateFrom = $_REQUEST['LastLoginDateFrom'] != '' ? new \DateTime($_REQUEST['LastLoginDateFrom']) : null; $this->lastLoginDateTo = $_REQUEST['LastLoginDateTo'] != '' ? new \DateTime($_REQUEST['LastLoginDateTo']) : null; $this->roleNames = array(); $index = 0; foreach ($roles as $role) { if (isset($_REQUEST[$role->name])) { $this->roleNames[$index] = $role->name; $index++; } } if (count($roles) == count($this->roleNames)) { $this->roleNames = null; } $this->roles = $roles; } }
/** * ManageDeleteModel constructor. * @param $title * @param bool $isRequest */ public function __construct($title, $isRequest = false) { parent::__construct($title); if ($isRequest) { $this->password = $_REQUEST['Password']; } }
/** * MainEditPageModel constructor. * @param $title * @param bool $isRequest */ public function __construct($title, $isRequest = false) { parent::__construct($title); if ($isRequest) { $this->id = $_REQUEST['Id']; $this->pageTitle = $_REQUEST['Title']; $this->metaKeywords = $_REQUEST['MetaKeywords']; $this->metaDescription = $_REQUEST['MetaDescription']; $this->body = $_REQUEST['Body']; $this->feedbackType = $_REQUEST['FeedbackType']; $this->menuView = isset($_REQUEST['MenuView']); $this->menuIndex = $_REQUEST['MenuIndex']; $this->homePageWidget = isset($_REQUEST['HomePageWidget']); $this->homePageWidgetIndex = $_REQUEST['HomePageWidgetIndex']; $this->homePageCarousel = isset($_REQUEST['HomePageCarousel']); $this->homePageCarouselIndex = $_REQUEST['HomePageCarouselIndex']; $this->hasPage = isset($_REQUEST['HasPage']); $this->parentId = $_REQUEST['ParentId'] == '' ? null : $_REQUEST['ParentId']; $this->userId = Authentication::getUserEntity()->id; if ($this->menuView && $this->pageTitle == '') { $this->pageTitleValidation = Language::$TITLE_CAN_NOT_BE_EMPTY[Config::$LANGUAGE]; $this->validation = false; } if (!$this->menuView && $this->body == '') { $this->bodyValidation = Language::$BODY_CAN_NOT_BE_EMPTY[Config::$LANGUAGE]; $this->validation = false; } } }
/** * FileEditModel constructor. * @param $title * @param bool $isRequest */ public function __construct($title, $isRequest = false) { parent::__construct($title); if ($isRequest) { $this->file = $_REQUEST['File']; $this->path = $_REQUEST['Path']; $this->extension = $_REQUEST['Extension']; } }
/** * AccountForgotPasswordModel constructor. * @param $title * @param bool $isRequest */ public function __construct($title, $isRequest = false) { parent::__construct($title); if ($isRequest) { $this->email = $_REQUEST['Email']; if ($this->email == '' || !filter_var($this->email, FILTER_VALIDATE_EMAIL)) { $this->emailValidation = Language::$INVALID_EMAIL[Config::$LANGUAGE]; $this->validation = false; } } }
/** * ManageChangePasswordModel constructor. * @param $title * @param bool $isRequest */ public function __construct($title, $isRequest = false) { parent::__construct($title); if ($isRequest) { $this->password = $_REQUEST['Password']; $this->newPassword = $_REQUEST['NewPassword']; $this->confirmNewPassword = $_REQUEST['ConfirmNewPassword']; if (strlen($this->newPassword) < Config::$MIN_PASSWORD_LENGTH) { $this->newPasswordValidation = Language::$PASSWORD_MUST_BE_AT_LEAST[Config::$LANGUAGE] . Config::$MIN_PASSWORD_LENGTH . Language::$CHARACTERS_LONG[Config::$LANGUAGE]; $this->validation = false; } if ($this->newPassword != $this->confirmNewPassword) { $this->confirmNewPasswordValidation = Language::$PASSWORDS_DO_NOT_MATCH[Config::$LANGUAGE]; $this->validation = false; } } }
/** * AdminEditUserModel constructor. * @param $title * @param bool $isRequest * @param null $roles */ public function __construct($title, $isRequest = false, $roles = null) { parent::__construct($title); if ($isRequest) { $this->id = $_REQUEST['Id']; $this->email = $_REQUEST['Email']; $this->lockoutEndDate = $_REQUEST['LockoutEndDate'] != '' ? new \DateTime($_REQUEST['LockoutEndDate']) : new \DateTime('2000-01-01 00:00:00'); $this->lockoutEnabled = isset($_REQUEST['LockoutEnabled']); $this->roleNames = array(); $index = 0; foreach ($roles as $role) { if (isset($_REQUEST[$role->name])) { $this->roleNames[$index] = $role->name; $index++; } } $this->roles = $roles; } }
/** * AccountRegisterModel constructor. * @param $title * @param bool $isRequest */ public function __construct($title, $isRequest = false) { parent::__construct($title); if ($isRequest) { $this->email = $_REQUEST['Email']; $this->password = $_REQUEST['Password']; $this->confirmPassword = $_REQUEST['ConfirmPassword']; $this->url = $_REQUEST['Url']; if ($this->email == '' || !filter_var($this->email, FILTER_VALIDATE_EMAIL)) { $this->emailValidation = Language::$INVALID_EMAIL[Config::$LANGUAGE]; $this->validation = false; } if (strlen($this->password) < Config::$MIN_PASSWORD_LENGTH) { $this->passwordValidation = Language::$PASSWORD_MUST_BE_AT_LEAST[Config::$LANGUAGE] . Config::$MIN_PASSWORD_LENGTH . Language::$CHARACTERS_LONG[Config::$LANGUAGE]; $this->validation = false; } if ($this->password != $this->confirmPassword) { $this->confirmPasswordValidation = Language::$PASSWORDS_DO_NOT_MATCH[Config::$LANGUAGE]; $this->validation = false; } } }
/** * FileIndexModel constructor. * @param $title */ public function __construct($title) { parent::__construct($title); }