本文整理汇总了PHP中Check::isLogin方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::isLogin方法的具体用法?PHP Check::isLogin怎么用?PHP Check::isLogin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Check
的用法示例。
在下文中一共展示了Check::isLogin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_add_message
function action_add_message()
{
if (Check::isLogin() != FALSE) {
$authorize = Check::isLogin();
}
if ($this->model->add_comment($_POST)) {
$data['success'] = 'you message added';
}
$this->view->generate('about_view.php', 'template_view.php', $data, $authorize);
}
示例2: action_index
function action_index($params)
{
$data = $this->model->get_data($params);
$content = '
<div class="video-info">
<div class="film-title">' . $data->name . '</div>
<div class="container-info">
<img src="' . $data->image . '">
<div class="info-summary">
<div class="infoi">
<h4 class="infoi-title">Год :</h4>
<div class="infoi-content">' . $data->year . '</div>
</div>
<div class="infoi">
<h4 class="infoi-title">Страна :</h4>
<div class="infoi-content">' . $data->country . '</div>
</div>
<div class="infoi">
<h4 class="infoi-title">Жанр :</h4>
<div class="infoi-content">' . $data->genre . '</div>
</div>
<div class="infoi">
<h4 class="infoi-title">Время :</h4>
<div class="infoi-content">' . $data->time . '</div>
</div>
<div class="infoi">
<h4 class="infoi-title">Качество :</h4>
<div class="infoi-content">' . $data->quality . '</div>
</div>
<div class="infoi">
<h4 class="infoi-title">Перевод :</h4>
<div class="infoi-content">' . $data->translation . '</div>
</div>
</div>
</div>
<div class="info">
<div class="info-title">Сюжет</div>
<div class="film-text">
' . $data->plot . '
</div>
</div>
</div>';
if (Check::isLogin() != FALSE) {
$authorize = Check::isLogin();
}
$this->view->generate('film_view.php', 'template_view.php', $content, $authorize);
}
示例3: action_create
function action_create()
{
$data = array("data" => array(), "error" => array());
$data_post = array();
if (isset($_POST)) {
foreach ($_POST as $key => $value) {
$data_post[$key] = $value;
}
}
if (empty($data_post['name'])) {
$data['error']['name'] = 'Введите имя';
}
if (empty($data_post['surname'])) {
$data['error']['surname'] = 'Введите фамилию';
}
if (!filter_var($data_post['email'], FILTER_VALIDATE_EMAIL)) {
$data['error']['email'] = 'Введите e-mail';
}
if (empty($data_post['password'])) {
$data['error']['password'] = 'Введите пароль';
}
if ($data_post['password'] != $data_post['password2']) {
$data['error']['password2'] = 'Пароли не совпадают';
}
if (count($data['error']) == 0) {
$data_post['password'] = md5($data_post['password']);
$result = $this->model->set_data($data_post);
if ($result == 'TRUE') {
$data['success'] = 'Спасибо за регистрацию ' . $data_post['name'];
} else {
$data['success'] = $result;
}
} else {
foreach ($data_post as $key => $value) {
$data['data'][$key] = $value;
}
}
if (Check::isLogin() != FALSE) {
$authorize = Check::isLogin();
}
$this->view->generate('registration_view.php', 'template_view.php', $data, $authorize);
}
示例4: action_logIn
function action_logIn()
{
$result = $this->model->get_data($_POST['email']);
if (!empty($result)) {
if ($result->password == md5($_POST['password'])) {
setcookie("id", $result->id, time() + 60 * 60 * 24, "/");
$host = 'http://' . $_SERVER['HTTP_HOST'] . '/';
header('Location:' . $host . 'main');
} else {
$data['error'] = "Неверный e-mail или пароль";
$data['email'] = $_POST['email'];
}
} else {
$data['error'] = "Проблемы соединения с базой данных";
$data['email'] = $_POST['email'];
}
if (Check::isLogin() != FALSE) {
$authorize = Check::isLogin();
}
$this->view->generate('login_view.php', 'template_view.php', $data, $authorize);
}
示例5: action_remove_film
function action_remove_film()
{
if (Check::isLogin() != FALSE) {
$authorize = Check::isLogin();
}
$data = $this->model->get_data();
$content = '';
$array_option = ['all', 'user', 'admin'];
foreach ($data as $item) {
$content .= '<tr>
<td>' . $item['name'] . '</td>
<td>' . $item['date_add'] . '</td>
<td>' . $item['author'] . '</td>
<td>
<select name="s' . $item['id'] . '">';
if ($item['status'] == 'OK') {
$content .= '<option selected>OK</option><option>0</option>';
} else {
$content .= '<option>OK</option><option selected>0</option>';
}
$content .= '</select></td>
<td><select name="p' . $item['id'] . '">';
foreach ($array_option as $option) {
if ($item['permission'] == $option) {
$content .= '<option selected>' . $option . '</option>';
} else {
$content .= '<option>' . $option . '</option>';
}
}
$item['permission'];
$content .= '</select></td>
<td><button name="id" type="submit" value="' . $item['id'] . '">Удалить</button></td>
</tr>
';
}
$this->view->generate('remove_view.php', 'template_view.php', $content, $authorize);
}