public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // firstname $this->addElement('text', 'firstname', ['label' => $translate->_('firstname'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => [['validator' => 'StringLength', 'options' => [1, 100]]]]); $this->getElement('firstname')->setAttrib('class', 'firstFocus'); // lastname $this->addElement('text', 'lastname', ['label' => $translate->_('lastname'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => [['validator' => 'StringLength', 'options' => [1, 100]]]]); // email $this->addElement('text', 'email', ['label' => $translate->_('email'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => ['EmailAddress']]); // password $this->addElement('password', 'password', ['label' => $translate->_('password'), 'required' => true, 'validators' => [['validator' => 'StringLength', 'options' => [8, null]]]]); // re-enter password $this->addElement('password', 'repassword', ['label' => $translate->_('password_reenter'), 'required' => true]); // agree to terms, data usage and data privacy / cookie usage $this->addElement('checkbox', 'agree', ['label' => $translate->_('signup_agree'), 'required' => true]); $this->getElement('agree')->setAttrib('class', 'checkbox'); $this->getElement('agree')->addValidator(new Zend_Validate_InArray(array(1)), false); // agree to sending emails $this->addElement('checkbox', 'agreenotify', ['label' => $translate->_('signup_agree_notify'), 'required' => false]); $this->getElement('agreenotify')->setAttrib('class', 'checkbox'); // submit $this->addElement('submit', 'submit', ['label' => $translate->_('signup'), 'require' => false]); // code $this->addElement('hidden', 'code', ['required' => false]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function sendActivated(Application_Model_Entity_SignUp $signUp) { $locale = new Zend_Locale($signUp->getLanguage()); $this->_translate = Application_Service_Language::getInstance($locale); $firstName = $signUp->getFirstName(); $lastName = $signUp->getLastName(); $link = stripslashes("https://{$this->_domain}/home/fead"); $message = $this->_translate->_('mail_dear') . " {$firstName} {$lastName},<br>" . $this->_translate->_('mail_activate_text') . "<br>{$link}"; $subject = $this->_translate->_('mail_activate_subject'); $this->send($signUp, $subject, $message); }
public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // email $this->addElement('text', 'email', ['label' => $translate->_('invite_label'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => ['EmailAddress']]); // submit $this->addElement('submit', 'submit', ['label' => $translate->_('invite_send'), 'ignore' => true]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { $translate = Application_Service_Language::getInstance(); // file $this->addElement('file', 'opml', ['label' => $translate->_('import_feads_label'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => [['validator' => 'Size', 8 * 1024 * 1024]]]); $this->getElement('opml')->addValidator('Extension', false, 'xml'); // submit $this->addElement('submit', 'submit', ['label' => $translate->_('import'), 'ignore' => true]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // folder $this->addElement('text', 'folder', ['label' => $translate->_('rename_folder_label'), 'required' => true, 'filters' => ['StringTrim']]); $this->getElement('folder')->setAttrib('class', 'firstFocus'); // submit $this->addElement('submit', 'submit', ['label' => $translate->_('rename_folder'), 'ignore' => true]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // url $this->addElement('text', 'url', ['label' => $translate->_('add_fead_label'), 'required' => true, 'filters' => ['StringTrim']]); $this->getElement('url')->setAttrib('onkeydown', 'if (13 === event.keyCode) addFead()'); // submit $this->addElement('button', 'submit', ['label' => $translate->_('add_fead'), 'ignore' => true]); $this->getElement('submit')->setAttrib('onclick', 'addFead()'); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // email $this->addElement('text', 'passwordold', ['label' => $translate->_('password_old'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => ['EmailAddress']]); // password $this->addElement('password', 'passwordnew', ['label' => $translate->_('password_new'), 'required' => true, 'validators' => [['validator' => 'StringLength', 'options' => [8, null]]]]); // re-enter password $this->addElement('password', 'repasswordnew', ['label' => $translate->_('password_reenter_new'), 'required' => true]); // submit $this->addElement('submit', 'submit', ['label' => $translate->_('passwprd_change'), 'ignore' => true]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // title $this->addElement('text', 'name', ['label' => $translate->_('title'), 'required' => true, 'filters' => ['StringTrim']]); // code $this->addElement('textarea', 'code', ['label' => $translate->_('code'), 'required' => true]); // active $this->addElement('checkbox', 'active', ['label' => $translate->_('active'), 'required' => true]); // submit $this->addElement('submit', 'submit', ['label' => $translate->_('add'), 'ignore' => true]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // email $this->addElement('text', 'email', ['label' => $translate->_('email'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => ['EmailAddress']]); $this->getElement('email')->setAttrib('class', 'firstFocus'); // password $this->addElement('password', 'password', ['label' => $translate->_('password'), 'required' => true]); // submit $this->addElement('submit', 'submit', ['label' => $translate->_('login'), 'igonore' => true]); // redirect $this->addElement('hidden', 'redirect', ['ignore' => true, 'required' => false]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { $this->setMethod('post'); $translate = Application_Service_Language::getInstance(); // email $this->addElement('text', 'email', ['label' => $translate->_('email'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => ['EmailAddress']]); // code $this->addElement('text', 'code', ['label' => 'Upgrade code', 'required' => true, 'filters' => ['StringTrim'], 'validators' => [['validator' => 'StringLength', 'options' => [10, null]]]]); // password $this->addElement('password', 'password', ['label' => 'New password', 'required' => true, 'validators' => [['validator' => 'StringLength', 'options' => [8, null]]]]); // re-enter password $this->addElement('password', 'repassword', ['label' => 'Re-enter new password', 'required' => true]); // submit $this->addElement('submit', 'submit', ['label' => 'Upgrade account', 'ignore' => true]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }
public function init() { parent::init(); $this->_acl = Application_Model_Acl::getInstance(); $isCron = 0 === strpos($_SERVER['REQUEST_URI'], '/cron'); if (!$isCron) { $this->_session = Application_Service_Session::getInstance(); } if ('index' === $this->getParam('controller') && 'unsupported' === $this->getParam('action')) { // $this->redirect('index/unsupported'); } $this->_mail = new Application_Service_Mail(); $this->_userRepo = Application_Model_UserRepository::getInstance(); $frontendOptions = ['lifetime' => 60, 'automatic_serialization' => true]; $backendOptions = ['cache_dir' => substr(APPLICATION_PATH, 0, strrpos(APPLICATION_PATH, '/')) . '/data/cache/']; $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions); Zend_Registry::set('Zend_Locale', new Zend_Locale('de')); Zend_Locale::setCache($cache); if (!$isCron && $this->isLoggedin()) { if (is_null($this->_session->getColor())) { $this->_session->setColor(Application_Model_UserSettingRepository::getInstance()->getSetting()->getColor()); } if (is_null($this->_session->getMenuStatic())) { $this->_session->setMenuStatic(Application_Model_UserSettingRepository::getInstance()->getSetting()->getMenuStatic()); } if (is_null($this->_session->getLanguage())) { $this->_session->setLanguage(Application_Model_UserSettingRepository::getInstance()->getSetting()->getLanguage()); } } $this->_translate = Application_Service_Language::getInstance(); Zend_Registry::set('Zend_Translate', $this->_translate); $this->view->translate = $this->_translate; if (!$isCron) { $this->view->staticMenu = intval($this->_session->getMenuStatic()); $this->view->color = $this->_session->getColor(); } }
public function init() { $translate = Application_Service_Language::getInstance(); $this->setMethod('post'); // firstname $this->addElement('text', 'firstname', ['label' => $translate->_('firstname'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => [['validator' => 'StringLength', 'options' => [1, 100]]]]); $this->getElement('firstname')->setAttrib('class', 'firstFocus'); // lastname $this->addElement('text', 'lastname', ['label' => $translate->_('lastname'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => [['validator' => 'StringLength', 'options' => [1, 100]]]]); // email /* $this->addElement('text', 'email', ['label' => $translate->_('email'), 'required' => true, 'filters' => ['StringTrim'], 'validators' => ['EmailAddress']] ); */ // submit $this->addElement('submit', 'submit', ['label' => $translate->_('save'), 'ignore' => true]); // csrf $this->addElement('hash', 'csrf', ['ignore' => true]); }