本文整理汇总了PHP中backend_url函数的典型用法代码示例。如果您正苦于以下问题:PHP backend_url函数的具体用法?PHP backend_url怎么用?PHP backend_url使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了backend_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle($request, Closure $next)
{
$auth = Auth::guard('backend');
if ($auth->check() and $auth->user()->hasRole('login')) {
return redirect(backend_url());
}
return $next($request);
}
示例2: handle
public function handle()
{
$password = str_random(8);
$user = $this->reflink->user;
Bus::dispatch(new EmailSend('user_new_password', ['password' => $password, 'name' => $user->name, 'email' => $user->email]));
$user->password = $password;
$user->save();
backend_auth()->login($user);
$this->redirectUrl = backend_url();
$this->message = trans(Password::PASSWORD_RESET);
}
示例3: _login_form
private function _login_form()
{
if (is_logged_in()) {
backend_url();
}
// Libreary
$this->load->library('form_validation');
// Validation Rules
$this->form_validation->set_rules('email', '"' . tr('_GLOBAL_email_') . '"', 'required|valid_email|trim');
$this->form_validation->set_rules('password', '"' . tr('_GLOBAL_password_') . '"', 'required|trim');
// Error Class
$data['form_class'] = '';
$data['form_error_class']['email'] = '';
$data['form_error_class']['password'] = '';
// Redirect
$this->session->keep_flashdata('redirect');
// Auth Login Form
if ($this->input->post('email') || $this->input->post('password')) {
// Check Validation
if (!$this->form_validation->run()) {
// Message Data
$data['form_class'] = 'danger';
$data['form_error'] = validation_errors();
$data['form_error_class']['email'] = form_error('email') ? 'has-error' : 'has-success';
$data['form_error_class']['password'] = form_error('password') ? 'has-error' : 'has-success';
} else {
// Form Values
$form['email'] = $this->input->post('email', TRUE);
$form['password'] = $this->input->post('password', TRUE);
$form['remember'] = $this->input->post('remember', TRUE);
// Load library
$this->load->model('auth_model');
// Check if user can login
if ($this->auth_model->login($form)) {
$redirect = $this->session->flashdata('redirect');
if (isset($redirect)) {
redirect($redirect, 'refresh');
} else {
redirect('backend');
}
} else {
// Message Data
$data['form_class'] = 'danger';
$data['form_error'] = $this->auth_model->error;
}
}
}
// Seo Data
$data['seo_description'] = tr('_SEO_PAGE_LOGIN_description_');
$data['seo_keywords'] = tr('_SEO_PAGE_AUTH_LOGIN_keywords_');
$data['seo_title'] = tr('_SEO_PAGE_AUTH_LOGIN_title_');
// Render Template
$this->template->set('template', 'login')->set('views', 'auth/login')->set('data', $data)->render();
}
示例4: secure_restrict
/**
* Protect a backend controller / function
*
* Default use is to bar non-members
* A user group can be specified to limit to that user group
*
* @access public
* @param string user group
*/
function secure_restrict()
{
if (!current_user('secure')) {
if (!$this->logged_in()) {
$this->CI->session->set_flashdata('error', 'You must log in to see this content.');
} else {
$this->CI->session->set_flashdata('msg', 'You must re-enter your password to see this content.');
}
redirect(backend_url('/session/login'));
}
}
示例5: _message
/**
* 信息提示
*
* @access public
* @param string
* @param string
* @param bool
* @param string
* @return void
*/
public function _message($msg, $goto = '', $auto = TRUE, $fix = '', $pause = 3000)
{
if ($goto == '') {
$goto = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : site_url();
} else {
$goto = strpos($goto, 'http') !== false ? $goto : backend_url($goto);
}
$goto .= $fix;
$this->_template('sys_message', array('msg' => $msg, 'goto' => $goto, 'auto' => $auto, 'pause' => $pause));
echo $this->output->get_output();
exit;
}
示例6: Preferences
/**
* Constructor
*
* @access public
*/
function Preferences()
{
$this->CI =& get_instance();
$query = $this->CI->db->get('general', 1, 0);
$this->prefs = $query->row();
// Set the default language to our global language
$this->CI->config->set_item('language', $this->prefs->language);
// Global config overrides
if ($this->CI->config->item('system_locked')) {
$this->prefs->locked = 1;
}
// Backend URLs
$this->set('backend_base_url', backend_url(''));
$this->set('backend_login', backend_url('session/login'));
}
示例7: view
/**
* 默认入口
*
* @access public
* @param int
* @return void
*/
public function view($role = 0)
{
$offset = $this->input->get('page', TRUE) ? $this->input->get('page', TRUE) : 0;
$data['list'] = $this->user_mdl->get_users($role, 15, $offset);
$data['role'] = $role;
$data['roles'] = $this->user_mdl->get_roles();
//加载分页
$this->load->library('pagination');
$config['base_url'] = backend_url('user/view') . '?dilicms';
$config['per_page'] = 15;
$config['page_query_string'] = TRUE;
$config['query_string_segment'] = 'page';
$config['total_rows'] = $this->user_mdl->get_users_num($role);
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$this->_template('user_list', $data);
}
示例8: add
public function add()
{
// Libreary
$this->load->library('form_validation');
// Validation Rules
$this->form_validation->set_rules('name', '"' . tr('_GLOBAL_name_') . '"', 'required|trim');
$this->form_validation->set_rules('lastname', '"' . tr('_GLOBAL_lastname_') . '"', 'required|trim');
$this->form_validation->set_rules('email', '"' . tr('_GLOBAL_email_') . '"', 'required|valid_email|trim');
$this->form_validation->set_rules('email_repeat', '"' . tr('_GLOBAL_email_repeat_') . '"', 'required|valid_email|matches[email]|trim');
$this->form_validation->set_rules('password', '"' . tr('_GLOBAL_password_') . '"', 'required|trim|min_length[6]|password_check[1,1,1]');
$this->form_validation->set_rules('password_repeat', '"' . tr('_GLOBAL_password_repeat_') . '"', 'required|matches[password]|trim');
// Form Error Content
// Return Data
$json = array('csrf' => array($this->security->get_csrf_token_name() => $this->security->get_csrf_hash()));
// Check Validation
if (!$this->form_validation->run()) {
$json['status'] = FALSE;
$json['message'] = validation_errors();
$json['rules'] = array('name' => form_error('name') ? 'has-error' : 'has-success', 'lastname' => form_error('lastname') ? 'has-error' : 'has-success', 'email' => form_error('email') ? 'has-error' : 'has-success', 'email_repeat' => form_error('email_repeat') ? 'has-error' : 'has-success', 'password' => form_error('password') ? 'has-error' : 'has-success', 'password_repeat' => form_error('password_repeat') ? 'has-error' : 'has-success');
} else {
// Load library
$this->load->model('auth_model');
// Form Values
$form['name'] = $this->input->post('name', TRUE);
$form['lastname'] = $this->input->post('lastname', TRUE);
$form['email'] = $this->input->post('email', TRUE);
$form['email_repeat'] = $this->input->post('email_repeat', TRUE);
$form['password'] = $this->input->post('password', TRUE);
$form['password_repeat'] = $this->input->post('password_repeat', TRUE);
if ($this->auth_model->create_account($form, 1, 1)) {
$json['status'] = TRUE;
$json['redirect'] = backend_url(array('users', 'edit', $this->auth_model->id));
} else {
$json['status'] = FALSE;
$json['message'] = $this->auth_model->error;
}
}
// Output
$this->output->set_header('Content-Type: application/json; charset=utf-8')->set_content_type('application/json')->set_output(json_encode($json));
}
示例9: base_url
');}">删除</a>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<script>
var base_url = '<?php
echo base_url();
?>
' ,backend_url = '<?php
echo backend_url() . $this->uri->segment(1);
?>
/',attachment_url = '<?php
echo $this->platform->file_url();
?>
';
var thumbDefaultSize = '<?php
echo $thumb_default_size;
?>
';
</script>
<link rel="stylesheet" href="js/contextMenu/jquery.contextMenu.css" />
<script src="js/contextMenu/jquery.contextMenu.js"></script>
<script src="js/contextMenu/jquery.ui.position.js"></script>
<script src="js/dili_utility/upload.js"></script>
示例10: plugin_url
function plugin_url($plugin, $controller, $method = 'index', $qs = array())
{
$ci =& get_instance();
if (false and $ci->config->item('index_page') === '') {
return backend_url("plugin/{$name}/{$controller}/{$method}", http_build_query($qs));
}
$qs['plugin'] = $plugin;
$qs['c'] = $controller;
$qs['m'] = $method;
return backend_url('module/run', http_build_query($qs));
}
示例11: registerMedia
public function registerMedia()
{
$errors = view()->shared('errors');
$this->templateScripts = ['CURRENT_URL' => $this->request->url(), 'SITE_URL' => url()->current(), 'BASE_URL' => backend_url(), 'BACKEND_PATH' => backend_url_segment(), 'BACKEND_RESOURCES' => resources_url(), 'PUBLIC_URL' => url()->current(), 'LOCALE' => Lang::getLocale(), 'ROUTE' => !is_null($this->getRouter()) ? $this->getRouter()->currentRouteAction() : null, 'ROUTE_PATH' => $this->getRouterPath(), 'REQUEST_TYPE' => $this->requestType, 'USER_ID' => backend_auth()->id(), 'MESSAGE_ERRORS' => !is_null($errors) ? $errors->getBag('default') : [], 'MESSAGE_SUCCESS' => (array) $this->session->get('success', [])];
}
示例12: _parse_users
/**
* Formateamos los resultados para mejor visibilidad
*
* @access private
* @param array $users Array con todos los usuarios
* @param bool $single Indica si debe solo devolver la primera fila
* @param array $return Variable de retorono de informacion
* @return array Devuelve el array con los datos formateados
*/
private function _parse_users($users = array(), $single = FALSE, $return = array())
{
foreach ($users as $user) {
$return[] = array('id' => $user['id'], 'url_delete' => backend_url(array('users', 'delete', $user['id'])), 'url_edit' => backend_url(array('users', 'edit', $user['id'])), 'url_change_password' => backend_url(array('users', 'change-password', $user['id'])), 'remember_token' => $user['remember_token'], 'register_token' => $user['register_token'], 'register_status' => $user['register_status'], 'forgot_token' => $user['forgot_token'], 'forgot_fecha' => $user['forgot_fecha'], 'forgot_status' => $user['forgot_status'], 'date_last_login' => date('d-m-Y', strtotime($user['date_last_login'])), 'date_last_mod_password' => date('d-m-Y', strtotime($user['date_last_mod_password'])), 'date_last_mod_profile' => date('d-m-Y', strtotime($user['date_last_mod_profile'])), 'date_register' => date('d-m-Y', strtotime($user['date_register'])), 'name' => $user['name'], 'lastname' => $user['lastname'], 'email' => $user['email'], 'password' => $user['password'], 'cargo' => $user['cargo'], 'vat' => $user['vat'], 'phone' => $user['phone'], 'mobile_phone' => $user['mobile_phone'], 'fax' => $user['fax'], 'address' => $user['address'], 'description' => $user['description'], 'status_id' => $user['status_id'], 'status' => tr('_GLOBAL' . $user['status']), 'permission_id' => $user['permission_id'], 'permission' => tr('_GLOBAL' . $user['permission']), 'permission_class' => $user['permission_class'], 'language' => $user['language'], 'language_id' => $user['language_id'], 'avatar' => !empty($user['avatar']) ? $this->template->thumb('uploads', $user['avatar'], array('w' => 150, 'h' => 150, 'type' => 'resize')) : $this->template->thumb('img', '_avatars/avatar.png', array('w' => 150, 'h' => 150, 'type' => 'resize')));
}
unset($users, $user);
return $single ? $return[0] : $return;
}
示例13: tr
<div class="page-header page-header-block">
<div class="page-header-section">
<h4 class="title semibold"><?php
echo tr('_BACKEND_configure_categories_');
?>
</h4>
</div>
<div class="page-header-section">
<div class="toolbar">
<a href="<?php
echo backend_url(array('bloger', 'categories'));
?>
" class="btn btn-danger">
<i class="ico-arrow-left"></i> <?php
echo tr('_BACKEND_go_back_');
?>
</a>
</div>
</div>
</div>
<div class="row">
<?php
echo form_open(NULL, array('class' => 'form-horizontal form-bordered form-ajax', 'id' => 'categories_edit_form', 'role' => 'form'));
?>
<div class="col-lg-12">
<div class="panel">
<div class="panel-body pt0 pb0">
<div class="form-group header bgcolor-default">
示例14: backend_url
</td>
<td><?php
echo $v->name;
?>
</td>
<td><?php
echo $v->status == 1 ? '正常' : '冻结';
?>
</td>
<td>
<a href="<?php
echo backend_url('user/edit/' . $v->uid);
?>
"><img class="operator" src="images/icon_edit.gif" alt="修改" title="修改"></a>
<a class="confirm_delete" href="<?php
echo backend_url('user/del/' . $v->uid);
?>
"><img class="operator" src="images/icon_del.gif" alt="删除" title="删除"></a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="pages_bar pagination"><?php
echo $pagination;
?>
</div>
<script language="javascript">
示例15: tr
<div class="form-group">
<label for="old_password" class="col-sm-3 control-label"><?php
echo tr('_GLOBAL_old_password_');
?>
</label>
<div class="col-sm-5">
<?php
echo form_password(array('name' => 'old_password', 'value' => set_value('old_password'), 'id' => 'old_password', 'class' => 'form-control', 'required' => 'required'));
?>
<?php
if ((bool) $this->settings_model->system['_user_forgot_enabled_'] === TRUE) {
?>
<p class="help-block"><a href="<?php
echo backend_url(array('auth', 'forgot'));
?>
"><?php
echo tr('_PAGE_AUTH_SIDEBAR_LINKS_forgot_');
?>
</a></p>
<?php
}
?>
</div>
</div>
<div class="form-group">
<label for="new_password" class="col-sm-3 control-label"><?php
echo tr('_GLOBAL_new_password_');