예제 #1
0
<?php

require_once "../JentiConfig.php";
require_once "../JentiSession.php";
require_once "TestSupport.php";
ob_start();
//ini_set('error_reporting', 0);
$session = new JentiSession($config);
if ($session->error) {
    test_echobr($session->error);
}
$session->login("gigi", "gigi");
if ($session->error) {
    test_echobr($session->error);
} else {
    $session->logout();
    if ($session->error) {
        test_echobr($session->error);
    }
}
//test_print_r($session);
//test_print_r($_COOKIE);
//test_print_r($catalog);
ob_end_flush();
//echo json_encode($session);
예제 #2
0
require_once "../JentiConfig.php";
require_once "../JentiUser.php";
$user = new JentiUser($config);
if ($user->error) {
    test_echobr($user->error);
}
/*
$user_input["EMAIL"] = "*****@*****.**";
$user_input["PASSWORD"] = "******";
$user->add_user($user_input);
if($user->error)
{
    test_echobr($user->error);
}

$user_info = $user->validate_user($user_input);
if($user->error)
{
    test_echobr($user->error);
}
*/
$user_info = $user->get_user("*****@*****.**");
if ($user->error) {
    test_echobr($user->error);
}
if (strlen($user_info["NAME"]) == 0) {
    $pos = strpos($user_info["EMAIL"], "@");
    $user_info["NAME"] = $pos === FALSE ? $user_info["EMAIL"] : substr($user_info["EMAIL"], 0, $pos);
}
test_print_r($user_info);
//echo json_encode($word);