Пример #1
0
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */
require_once "Libs/autoload.php";
$config = new Config();
$webPage = new PJSWebPage($config->getTitle() . ' - Delete Search');
$act = Tools::Param('act');
if ("Delete Search" === $act) {
    $searchModel = new SearchModel();
    $searchModel->populateFromForm();
    if (!$searchModel->validateForDelete()) {
        $searchView = new SearchFormView('Delete Search', $searchModel);
        $body = "<h2>Invalid data</h2>\n" . $searchView->getForm();
    } else {
        $searchController = new SearchController();
        $searchController->delete($searchModel);
        $body = "Deleted search # " . $searchModel->getId() . "<br />\n";
    }
} else {
    $searchController = new SearchController();
    $searchModel = $searchController->get(Tools::param('id'));
Пример #2
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */
require_once 'Libs/autoload.php';
// Be sure to specify these in apply order. The reset script will automatically
// reverse the order for safe removal.
$controllerNames = array('VersionController', 'AuthTicketController', 'ApplicationStatusController', 'ApplicationStatusSummaryController', 'CompanyController', 'ContactController', 'JobController', 'KeywordController', 'NoteController', 'SearchController', 'JobKeywordMapController');
$controllers = array();
try {
    $config = new Config();
    $page = new PJSWebPage($config->getTitle() . " - Reset DB", true);
    $body = "<ul>\n";
    $dbc = new DBConnection("admin", null, null, null, null, null, 'mysqli', true);
    if (!$dbc->getCreatedDb()) {
        // Database exists. Don't allow reset if the user is not logged in.
        $auth = new Auth();
        if (!$auth->isAuthorized()) {
            throw new Exception("User must be logged in to reset the database!");
        }
        if ("1" !== $config->getResetOk()) {
            throw new Exception("Reset capability is turned off! See config.xml");
        }
    }
    $dbh = $dbc->getConnection();
    foreach (array_reverse($controllerNames) as $controllerName) {
        $controller = new $controllerName('write');
Пример #3
0
 * phpjobseeker
 *
 * Copyright (C) 2009, 2015 Kevin Benton - kbenton at bentonfam dot org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */
require_once 'Libs/autoload.php';
// @todo Show application statuses in index page
$config = new Config();
try {
    $dbc = new DBConnection();
} catch (DaoException $ex) {
    echo "Has this system been set up yet? Have you used resetDb.php?\n";
    exit;
}
$config = new Config();
$page = new PJSWebPage($config->getTitle());
$page->displayPage();