Login   Register  
PHP Classes
elePHPant
Icontem

File: jApi_client/login.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bijaya Kumar Behera  >  jApi RPC  >  jApi_client/login.php  >  Download  
File: jApi_client/login.php
Role: Example script
Content type: text/plain
Description: example file
Class: jApi RPC
Handle client and server API calls
Author: By
Last change: logout added
Date: 10 months ago
Size: 1,092 bytes
 

Contents

Class file image Download
<?php
/*
*  Example
*/
session_start();
require_once(
"./jApi_config.php");

if (isset(
$_GET['logout'])) {
    require_once(
"./jApi_libs/src/jApi_verify.class.php");
    
    
// logout jApi session
    
if ( isset($_SESSION['AUTH']['jApi_refresh_token'][jApi_auth_token]) ){
        
jApi_verify::logout(jApi_session_callbackjApi_auth_token ,$_SESSION['AUTH']['jApi_refresh_token'][jApi_auth_token]);
    }

    
session_destroy();
    
header('Location: index.php');
    exit();
}

if ( isset(
$_SESSION['AUTH']['uid']) && !empty($_SESSION['AUTH']['uid']) )
    
header('Location: index.php');
If ( isset(
$_POST['uname']) && isset($_POST['upass'])  && ($_POST['uname'] == 'user' && $_POST['upass'] =='password' ) ) {
    
$_SESSION['AUTH']['uname'] = 'user';
    
$_SESSION['AUTH']['uid'] = '1';
    
header('Location: index.php');    
}
?>
<h2> Login</h2>
<hr />
<form method="post" >
User Name : <input type="text" name="uname" value="" />
Password :  <input type="password" name="upass" value="" />
<input type='submit' name="btnLogin" value='login' />
<br /><i> user : user, password: password</i>
</form>