private function handleUpdate($requestData) { if ($this->authenticator->userAuthenticates($requestData["email"], $requestData["auth-key"])) { $versioning = new DIM_Versioning(); if ($versioning->databaseNeedsUpdating()) { $querymanager = new DIM_QueryManager(); $querymanager->beginUpdate(); return "1:update-success"; } return "0:no-update-available"; } return "0:unauthed"; }
private function __indexPage() { $versioning = new DIM_Versioning(); $link = new XMLElement('link'); $this->addElementToHead($link, 500); $this->setPageType('table'); $this->appendSubheading(__('Database Updating')); $fieldSet = new XMLElement('fieldset', '', array('class' => 'settings')); $fieldSet->appendChild(new XMLElement('legend', 'Database Update')); $message = new XMLElement('div'); if ($versioning->databaseNeedsUpdating()) { $querymanager = new DIM_QueryManager(); $querymanager->beginUpdate(); $message->appendChild(new XMLElement('h2', "Update Completed!")); redirect('../?message=update-success'); } else { $message->appendChild(new XMLElement('h2', "Database Already Up To Date")); } $fieldSet->appendChild($message); $this->Form->appendChild($fieldSet); }