本文整理汇总了PHP中Owner::isAuthenticated方法的典型用法代码示例。如果您正苦于以下问题:PHP Owner::isAuthenticated方法的具体用法?PHP Owner::isAuthenticated怎么用?PHP Owner::isAuthenticated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owner
的用法示例。
在下文中一共展示了Owner::isAuthenticated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
if (!Owner::isAuthenticated() && !Agent::isAuthenticated()) {
$this->redirect('/');
} else {
$this->view('dashboard/index');
}
}
示例2: addtenant
public function addtenant($propertyId)
{
if (!Owner::isAuthenticated()) {
$this->redirect('/');
} else {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} else {
$this->view('templates/interfaceStart');
$this->view('owner/addtenant');
$this->view('templates/interfaceEnd');
}
}
}
示例3: index
public function index()
{
$_SESSION['sidebar'] = 'dashboard';
if (Owner::isAuthenticated()) {
// if owner is authenticated
// TODO: display owner dashboard
$this->redirect('/propertyowner/index');
} elseif (Tenant::isAuthenticated()) {
// if tenant is authenticated
// TODO: display tenant dashboard
$this->redirect('/propertytenant/index');
} elseif (Agent::isAuthenticated()) {
// if agent is authenticated
// TODO: display agent dashboard
$this->redirect('/propertyagent/index');
} elseif (Real_Estate::isAuthenticated()) {
// if real estate is authenticated
// TODO: display real estate dashboard
$this->redirect('/realest/index');
} else {
// if no one is authenticated
// display landing page
$this->setJavascriptDependencies([WEBDIR . '/js/jquery.js', WEBDIR . '/js/bootstrap.min.js', 'http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js', WEBDIR . '/js/classie.js', WEBDIR . '/js/cbpAnimatedHeader.js', WEBDIR . '/js/wallfly.js', 'http://cdn.jsdelivr.net/jquery.validation/1.14.0/jquery.validate.js', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/additional-methods.js', WEBDIR . '/js/index.js']);
$this->view('home/index');
}
// TEST
// $owner = Owner::create([
// 'email' => 'john@example.com',
// 'password' => 'password',
// 'firstname' => 'John',
// 'lastname' => 'Doe',
// 'phone' => '12345123',
// 'photo' => NULL
// ]);
// $agent = Agent::create([
// 'email' => 'jane@example.com',
// 'password' => 'password',
// 'firstname' => 'Jane',
// 'lastname' => 'Doe',
// 'phone' => '12345123',
// 'photo' => NULL,
// 'real_estate_id' => 2
// ]);
// $realestate = Real_Estate::create([
// 'name' => 'Ray White',
// 'password' => 'password',
// 'address' => 'address',
// 'email' => 'ray@white.com',
// 'phone' => '12345123',
// 'photo' => NULL
// ]);
// $property = Property::create([
// 'address' => 'address',
// 'payment_schedule' => 'payment_schedule',
// 'rent_amount' => 'rent_amount',
// 'photo' => NULL,
// 'real_estate_id' => NULL,
// 'agent_id' => NULL,
// 'owner_id' => NULL
// ]);
}