name = 'ant_resetbopassword'; $this->tab = 'administration'; $this->author = 'Antadis'; $this->version = '1.0'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Sécurité BO'); $this->description = $this->l('Envoi, tous les X mois, une demande de changement de mot de passe aux employés'); } public function install() { if(!(parent::install())) { return false; } Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'employee` ADD `date_passwd_upd` DATETIME DEFAULT "'.pSQL(date("Y-m-d H:i:s")).'"'); # Set default configuration values Configuration::updateValue('ANT_RESETBOPASSWORD_FREQ', 3); // month Configuration::updateValue('ANT_RESETBOPASSWORD_LIMIT', 7); // day Configuration::updateValue('ANT_RESETBOPASSWORD_DATE', date('Y-m-d H:i:s')); // last date of updating return true; } public function uninstall() { if(parent::uninstall() == false) { return false; } Configuration::deleteByName('ANT_RESETBOPASSWORD_FREQ'); Configuration::deleteByName('ANT_RESETBOPASSWORD_LIMIT'); Configuration::deleteByName('ANT_RESETBOPASSWORD_DATE'); return true; } public function getContent() { global $cookie, $currentIndex; if(Tools::isSubmit('submitUpdate')) { Configuration::updateValue('ANT_RESETBOPASSWORD_FREQ', Tools::getValue('frequency')); Configuration::updateValue('ANT_RESETBOPASSWORD_LIMIT', Tools::getValue('limit')); } $helper = new HelperFormBootstrap(); $this->_html .= $helper->renderStyle(); $this->_html .= '