예제 #1
0
 public static function add($login, $password)
 {
     $coding = PwUser::pwd_coding;
     if (!empty($coding)) {
         $password = $coding($password);
     }
     $um = new usersModel();
     $um->login = $login;
     $um->password = $password;
     $um->regdate = date('Y-m-d');
     return $um->insert();
 }
예제 #2
0
파일: users.php 프로젝트: dgerena/SSL
if (isset($_GET['yaPass'])) {
    $uMod->login($_GET['yaName'], $_GET['yaPass']);
} elseif (isset($_GET['userId'])) {
    $clients = $uMod->getClients();
    require_once 'views/userpage.php';
} elseif (isset($_GET['delClient'])) {
    $uMod->deleteClient($_GET['delClient']);
    header('Location: ./');
} elseif (isset($_GET['update'])) {
    $uMod->update($_GET['id'], $_GET['title'], $_GET['message']);
    header('Location: ./?clientId=' . $clientId);
} elseif (isset($_GET['delete'])) {
    $uMod->delete($_GET['id']);
    header('Location: ./?clientId=' . $_GET['clientId']);
} elseif (isset($_GET['title'])) {
    $uMod->insert($_GET['clientId'], $_GET['title'], $_GET['message']);
    header('Location: ./?clientId=' . $_GET['clientId']);
} elseif (isset($_GET['signout'])) {
    session_destroy();
    header('Location: index.php');
} elseif (isset($_GET['newClient'])) {
    $uMod->newClient($_GET['newClient']);
    header('Location: index.php');
} elseif (isset($_GET['clientId'])) {
    $messages = $uMod->getMsgs($_GET['clientId']);
    require_once 'views/msgview.php';
} elseif (isset($_SESSION['userId'])) {
    $clients = $uMod->getClients();
    require_once 'views/userpage.php';
} else {
    echo "No session is currently set";