/** * AdminConfig@generateToken * * Ajax call to generate a new token. Display the token, if generated. * Tokens call only be generated by a site administrator. * */ public function generateToken() { $controller = new AjaxController(); $controller->restrictAccess(Auth::isAdmin()); $token = Functions::generateRandomToken(); $this->module->setSetting('MAJ_AT_FORCE_EXEC_TOKEN', $token); Log::addConfigurationLog($this->module->getTitle() . ' : New token generated.'); $controller->pageHeader(); echo $token; }