PHP code example of redcatphp / identify

1. Go to this page and download the library: Download redcatphp/identify library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

redcatphp / identify example snippets


$name = 'redcat';  
$cookieLifetime = 3600; // 1 hour  
$sessionLifetime = 43200;  // 1 year  
$session = new \\RedCat\\Identify\\Session($name,$cookieLifetime,$sessionLifetime);  
if(isset($session['var']))  
    var\_dump( $session['var'] );  
$session['var'] = 'value';  
            

$auth->login($login, $password, $lifetime=0);  
            

$auth->loginRoot($password,$lifetime=0);  
            

$auth->loginPersona($email,$lifetime=0);  
            

$auth->register($email, $login, $password, $repeatpassword, $name=null);  
            

$auth->activate($key);  
            

$auth->requestReset($email);  
            

$auth->logout();  
            

$auth->getHash($string, $salt);  
            

$auth->getUID($login);  
            

$auth->getUser($uid);  
            

$auth->deleteUser($uid, $password);  
            

$auth->validateLogin($login);  
            

$auth->validateDisplayname($login);  
            

$auth->resetPass($key, $password, $repeatpassword);  
            

$auth->resendActivation($email);  
            

$auth->changePassword($uid, $currpass, $newpass, $repeatnewpass);  
            

$auth->getEmail($uid);  
            

$auth->changeEmail($uid, $email, $password);  
            

$auth->getRight();  
            

$auth->setRight($r);  
            

$auth->connected();  
            

$auth->allowed($d);  
            

$auth->allow($d);  
            

$auth->deny($d);  
            

$auth->lock($r,$redirect=true);  
            

$authServer = new \\RedCat\\Identify\\AuthServer;  
$authServer->htmlLock('RIGHT\_MANAGE',true);  
            

$authServer->lougoutBTN();  
            

$authServer->action();  
            

$session = $authServer->getSession();  
$identity = $session['\_AUTH\_'];  
            

$authServer->resetreq();  
            

$authServer->resetpass();  
            

$authServer->getAuth()->logout()  
            

echo $authServer->getResultMessage(true);  
            

$mailer = new RedCat\\Identify\\PHPMailer(  
    $fromEmail,$fromName,  
    $replyEmail,$replyName,  
    $host,$port,$username,$passowrd,$secure,  
    $sendmail,  
    $debug,$exceptions  
);  
$mailer->mail($email, $subject, $message, $html=true);