// Insert into DB $contactsNew = new Contacts(); $contactsNew->setFname($_POST['fname']); $contactsNew->setSname($_POST['sname']); $contactsNew->setCo_name($_POST['co_name']); $contactsNew->setRole($_POST['role']); $contactsNew->setCustid($_POST['custid']); $contactsNew->setSuppid($_POST['suppid']); $contactsNew->setAddsid($addsid); $contactsNew->setNotes($_POST['notes']); $contactId = $contactsNew->insertIntoDB(); // Insert into DB $pwdNew = new Pwd(); $pwdNew->setUsr($logon); $pwdNew->setContactsid($contactId); $pwdNew->setSeclev(100); $pwdNew->setPw(mkPwd($pw)); file_put_contents('/etc/athenace/pwd', "{$_POST['custid']}\t{$_POST['suppid']}\t{$logon}\t{$pw}\n", FILE_APPEND); // Dont add to the Password table unless they have a custid or a suppid if (isset($_POST['custid']) && $_POST['custid'] > 0 || isset($_POST['suppid']) && $_POST['suppid'] > 0) { $pwdNew->insertIntoDB(); } else { // Not adding to passwd table // i.e contacts not associated with a customer or supplier cant log in } $logresult = logEvent(6, $logContent); header("Location: /contacts/?Added=" . $result['id']); exit; } include "../tmpl/header.php"; if (isset($_GET['FromAddCustomer'])) {
$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> </p> <form role="form"