Beispiel #1
0
Datei: Login.php Projekt: rjha/sc
 static function startOAuth2Session($loginId, $provider)
 {
     // get denorm data on login from $userDao
     // the data in sc_user is for first time creation only
     // and denorm columns like name etc. can be stale in sc_user
     $userDao = new \com\indigloo\sc\dao\User();
     $userDBRow = $userDao->getOnLoginId($loginId);
     // is banned?
     $ban_bit = $userDBRow["bu_bit"];
     settype($ban_bit, "integer");
     if ($ban_bit == 1) {
         //donot start session
         return self::FORBIDDEN_CODE;
     }
     //start session
     $_SESSION[self::LOGIN_ID] = $loginId;
     $_SESSION[self::NAME] = $userDBRow["name"];
     $_SESSION[self::PROVIDER] = $provider;
     $_SESSION[self::TOKEN] = Util::getBase36GUID();
     // complete any pending session action.
     self::completeSessionAction($loginId, $userDBRow["name"], $provider);
     return self::OK_CODE;
 }
Beispiel #2
0
//sc/site/contact.php
include 'sc-app.inc';
include APP_WEB_DIR . '/inc/header.inc';
use com\indigloo\Util;
use com\indigloo\Url;
use com\indigloo\sc\auth\Login;
use com\indigloo\ui\form\Sticky;
use com\indigloo\Constants;
use com\indigloo\ui\form\Message as FormMessage;
$gWeb = \com\indigloo\core\Web::getInstance();
$sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true));
$qUrl = Url::tryBase64QueryParam("q", "/");
$fUrl = Url::current();
//add security token to form
$formToken = Util::getBase36GUID();
$gWeb->store("form.token", $formToken);
?>

<!DOCTYPE html>
<html>

       <head>
        <title> 3mik.com - contact us </title>
        <?php 
include APP_WEB_DIR . '/inc/meta.inc';
?>
        <?php 
echo \com\indigloo\sc\util\Asset::version("/css/bundle.css");
?>