コード例 #1
0
ファイル: ldap.php プロジェクト: calliander/wywo
<?php

//	Genius Room: WYWO
//	Script: LDAP for AJAX
//	Revision: 3.0.6
#	-----	This is the LDAP file that jQuery uses for its AJAX call.
#			First loads common functions.
require '../genius.php';
#	-----	Had to put defaults or OpenDirectory goes nuts.
$uid = $_GET['u'] ? $_GET['u'] : 'wywo';
$pw = $_GET['p'] ? $_GET['p'] : 'wywo';
#	-----	Output the login attempt.
if ($login = get_ldap($uid, $pw)) {
    echo $login[0]['cn'][0];
}
#echo( get_ldap( $uid, $pw ) );
// Copyright: 2010 by Michael V. Colianna
コード例 #2
0
ファイル: view.php プロジェクト: calliander/wywo
 }
 // Add the primary number.
 $page[] = '				<div class="call_info" id="call_primary_' . $call['id'] . '">';
 $page[] = '					<span class="primary_text" id="primary_text_' . $call['id'] . '"><strong>Phone #1:</strong> ' . phone_text($call['primary']) . '</span>';
 $page[] = '				</div>';
 // Add the secondary number if it exists.
 if ($call['secondary']) {
     $page[] = '				<div class="call_info" id="call_secondary_' . $call['id'] . '">';
     $page[] = '					<span class="secondary_text" id="secondary_text_' . $call['id'] . '"><strong>Phone #2:</strong> ' . phone_text($call['secondary']) . '</span>';
     $page[] = '				</div>';
 }
 // Employee who closed the call.
 $employee = mysql_real_escape_string($_COOKIE['wywo_user']);
 $password = $_COOKIE['wywo_pass'];
 // Get employee info for ability to close.
 $user = get_ldap($employee, $password);
 // Add the close link if a WYWO admin and the call is old.
 if (strpos($user[0]['apple-user-printattribute'][0], 'ALL') != FALSE && $call['status'] == 'old') {
     $page[] = '				<div class="call_close" id="call_close_' . $call['id'] . '">';
     $page[] = '					<a class="helped" href="./?area=close&id=' . $call['id'] . '" id="link_close_' . $call['id'] . '">Mark as Helped</a>';
     $page[] = '				</div>';
 }
 // Finish the left side.
 $page[] = '			</div>';
 // Pull notes for output.
 $notes_pull = mysql_query("SELECT * FROM `notes` WHERE `call`='" . $call['id'] . "' ORDER BY `id` DESC");
 // Get the newest note. (This may be the only note.)
 $newest_note = mysql_fetch_assoc($notes_pull);
 // Start the right side with the newest note.
 $page[] = '			<div class="call_right" id="call_right_' . $call['id'] . '">';
 $page[] = '				<div class="newest_note" id="newest_note_' . $call['id'] . '">';
コード例 #3
0
ファイル: crumbs.php プロジェクト: calliander/wywo
//	Genius Room: WYWO
//	Script: Authentication page
//	Revision: 3.0.6
#	-----	Log out if already logged in.
if ($_COOKIE['wywo_user']) {
    setcookie('wywo_user', '');
    die(header('Location:./'));
}
#	-----	The title text.
$title = ' - Log In';
#	-----	This is to account for redirecting to the add page.
$add = $_GET['go'] == 'add' ? '&go=add' : '';
#	-DOC-	If the AJAX check worked, actually log in.
if ($_POST['login']) {
    // Check login again so the cookie can be made.
    if ($login = get_ldap(clean_text($_POST['username']), $_POST['password'])) {
        // Account for the redirect.
        $go = $_GET['go'] == 'add' ? '?area=add' : '';
        // Log 'em in and redirect accordingly.
        setcookie('wywo_user', $login[0]['cn'][0]);
        setcookie('wywo_pass', $_POST['password']);
        die(header('Location:./' . $go));
        // Redirect otherwise.
    } else {
        die(header('./?area=crumbs' . $add));
    }
}
#	-----	This is the HTML in the page buffer.
#			I am aware that PHP has an OB built in. I don't like it.
$page[] = '		<form action="./?area=crumbs' . $add . '" id="login" method="post">';
$page[] = '			<div id="login_information">';