コード例 #1
0
ファイル: add.php プロジェクト: athenasystems/athena
    $pw = generatePassword();
    // Add to Address table
    $addsid = db_addAddress($_POST);
    # Insert into DB
    $staffNew = new Staff();
    $staffNew->setFname($_POST['fname']);
    $staffNew->setSname($_POST['sname']);
    $staffNew->setAddsid($addsid);
    $staffNew->setJobtitle($_POST['jobtitle']);
    $stfid = $staffNew->insertIntoDB();
    $usr = generateStafflogon($_POST['fname'], $_POST['sname']);
    $staffPwd = mkPwd($pw);
    # Insert Pwd into DB
    $pwdNew = new Pwd();
    $pwdNew->setUsr($usr);
    $pwdNew->setStaffid($stfid);
    $pwdNew->setPw($staffPwd);
    $pwdNew->insertIntoDB();
    file_put_contents('/etc/athenace/pwd', "Staff\t{$stfid}\t{$usr}\t{$pw}\n", FILE_APPEND);
    $logresult = logEvent(15, $logContent);
    $done = 1;
}
include "../tmpl/header.php";
if ($done) {
    ?>
<h1>New staff member has been added</h1>
<h2>Write down the password now. It cannot be found anywhere else.</h2>
Username:
<?php 
    echo $usr;
    ?>
コード例 #2
0
ファイル: access.php プロジェクト: athenasystems/athena
$keywords = '';
$description = '';
include "/srv/athenace/lib/shared/common.php";
include "/srv/athenace/lib/intranet/common.php";
include "/srv/athenace/lib/shared/functions_form.php";
if (!is_numeric($_GET['id'])) {
    header("Location: /staff/?id=notFound");
    exit;
}
$pwhelp = '';
if (isset($_GET['go']) && $_GET['go'] == "y") {
    $pwdid = getPwdID($_GET['id']);
    # Update DB
    $pwdUpdate = new Pwd();
    $pwdUpdate->setPwdid($pwdid);
    $pwdUpdate->setStaffid($_GET['id']);
    $pwdUpdate->setSeclev($_POST['seclev']);
    $pwdUpdate->updateDB();
    #	$logresult = logEvent(15,$logContent);
    $done = 1;
}
$pagetitle = "staff";
include "../tmpl/header.php";
?>

<h1>Staff Access</h1>

<h2>Choose which site this user should log in to ...</h2>

<p>&nbsp;</p>