Ejemplo n.º 1
0
$description = $_REQUEST['description'];
$contact = $_REQUEST['contact'];
$contactemail = $_REQUEST['contactemail'];
if (!($active = $_REQUEST['active'])) {
    $active = 0;
}
try {
    if ($id) {
        $q = Doctrine_Query::create()->from('WPTHost h')->where('h.Id= ?', $id);
        $result = $q->fetchOne();
        $q->free(true);
        if ($result) {
            $wptHost = $result;
        } else {
            //TODO: Passed in an Id, but didn't find it. Add error here.
        }
    } else {
        $wptHost = new WPTHost();
    }
    $wptHost['Active'] = $active;
    $wptHost['Label'] = $label;
    $wptHost['Description'] = $description;
    $wptHost['HostURL'] = $hosturl;
    $wptHost['Contact'] = $contact;
    $wptHost['ContactEmailAddress'] = $contactemail;
    $wptHost->save();
} catch (Exception $e) {
    error_log("[WPTMonitor] Failed while updating host" . $e->getMessage());
}
header("Location: listHosts.php");
exit;
Ejemplo n.º 2
0
         $config['SiteHomePageMessage'] = $_REQUEST['siteHomePageMessage'];
         $config['SiteAlertFromName'] = $_REQUEST['siteAlertFromName'];
         $config['SiteAlertFromEmailAddress'] = $_REQUEST['siteAlertFromEmailAddress'];
         $config['SiteAlertMessage'] = $_REQUEST['siteAlertMessage'];
         $config->save();
         $user = new User();
         $user['Username'] = $adminUsername;
         $user['LastName'] = $adminFirstName;
         $user['FirstName'] = $adminLastName;
         $user['Password'] = $adminPassword;
         $user['IsSuperAdmin'] = true;
         $user['IsActive'] = true;
         $user['MaxJobsPerMonth'] = 9999999;
         $user['EmailAddress'] = $adminEmailAddress;
         $user->save();
         $host = new WPTHost();
         $host['Active'] = true;
         $host['Label'] = $hostLabel;
         $host['Contact'] = $hostContact;
         $host['ContactEmailAddress'] = $hostContactEmail;
         $host['HostURL'] = $hostUrl;
         $host->save();
         $_SESSION['ls_id'] = 1;
         //include 'FixFolders.php';
         updateLocations(1);
         header("Location: install.php?step=3");
     } else {
         echo "<br><h2>Warning!</h2><br><h3>Database file already exists.<br></h3>To reinitialize remove/drop the wpt_monitor database. If using sqlite this will be wpt_monitor.sqlite in the db direcotry.<br>";
     }
 } catch (Exception $e) {
     echo $e;