示例#1
0
 public function blqLogin()
 {
     $fbUserProfile = \core\wrapper\FacebookWrapper::getUserProfileFromRedirect();
     $data = array('fb_id' => $fbUserProfile->getId(), 'login_type' => self::LOGIN_TYPE_FB, 'email' => $fbUserProfile->getEmail(), 'created' => date('Y-m-d H:i:s'), 'name' => $fbUserProfile->getName(), 'gender' => 'unisex', 'birth_date' => 'n/a', 'token' => null, 'email_confirmed' => true);
     $fbLogin = Ubermodel::getAll('fb_logins', array('WHERE' => array('fb_id' => $data['fb_id'])));
     if (empty($fbLogin)) {
         $this->addNewUser($data);
     } else {
         $this->_login($data);
     }
     header('Location: /index.php?page=Posts');
     die;
 }
示例#2
0
<h1 class="text-center">LOGIN</h1>

<h3> Log in with Facebook </h3>
<?php 
echo '<a href="' . \core\wrapper\FacebookWrapper::getLoginUrl() . '"> Login With FB </a>';
?>


<h3> Log in with a communityblog account</h3>

<form role="form" action="index.php?page=Users&action=login " method="post">

    <div class="form-group">
        <label for="title">Email</label>
        <input type="text" class="form-control" id="email" name="email" placeholder="Enter Email" required>
    </div>

    <div class="form-group">
        <label for="body">Password</label>
        <input type="password" class="form-control" id="password" name="password" placeholder="Enter Password" required>
    </div>

    <button type="submit" class="btn btn-default">Submit</button>

</form>
示例#3
0
    define("__ROOT__", __DIR__);
}
if (!defined("__APPNAME__")) {
    define("__APPNAME__", array_pop(explode('/', __ROOT__)));
}
// This is either dev.{developer handle} or just production
if (!defined("__ENVIRONMENT__")) {
    define("__ENVIRONMENT__", 'dev.peter');
}
if (__ENVIRONMENT__ == 'production') {
    if (!defined("__SITENAME__")) {
        define("__SITENAME__", 'partyplant.eu');
    }
}
if (__ENVIRONMENT__ == 'dev.peter') {
    if (!defined("__SITENAME__")) {
        define("__SITENAME__", 'partyplant.dev');
    }
}
function autoloadAll($class)
{
    $parts = explode('\\', $class);
    include __ROOT__ . '/' . implode('/', $parts) . '.php';
}
spl_autoload_register('autoloadAll');
// Composer Autoloader
require __ROOT__ . '/vendor/autoload.php';
\core\wrapper\FacebookWrapper::init();
\app\model\Ubermodel::initialize();
class_alias('\\core\\utils\\Utils', 'Utils', true);
$router = new \core\router\Router($_GET);