本文整理汇总了PHP中Security::strip_tags方法的典型用法代码示例。如果您正苦于以下问题:PHP Security::strip_tags方法的具体用法?PHP Security::strip_tags怎么用?PHP Security::strip_tags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Security
的用法示例。
在下文中一共展示了Security::strip_tags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
public function action_index()
{
// load language
\Lang::load('account');
if (\Input::method() == 'POST') {
// store data for model
$data['account_email'] = \Security::strip_tags(trim(\Input::post('account_email')));
// validate form.
$validate = \Validation::forge();
$validate->add('account_email', \Lang::get('account_email'), array(), array('required', 'valid_email'));
if (!\Extension\NoCsrf::check(null, null, null, null, false)) {
// validate token failed
$output['form_status'] = 'error';
$output['form_status_message'] = \Lang::get('fslang_invalid_csrf_token');
} elseif (!$validate->run()) {
// validate failed
$output['form_status'] = 'error';
$output['form_status_message'] = $validate->show_errors();
} else {
// check registered emails with not confirm
$query = \Model_Accounts::query()->select('account_id', 'account_username', 'account_email')->where('account_email', $data['account_email'])->where('account_last_login', null)->where('account_status', '0')->where('account_confirm_code', '!=', 'NULL');
if ($query->count() <= 0) {
$output['form_status'] = 'error';
$output['form_status_message'] = \Lang::get('account_didnot_found_entered_email');
} else {
$row = $query->get_one();
// generate confirm code
$data['account_confirm_code'] = \Str::random('alnum', 6);
$data['account_username'] = $row->account_username;
$options['not_notify_admin'] = true;
// send email to let user confirm registration
$result = \Model_Accounts::forge()->sendRegisterEmail($data, $options);
if ($result === true) {
$account = \Model_Accounts::find($row->account_id);
$account->account_confirm_code = $data['account_confirm_code'];
$account->save();
$output['form_status'] = 'success';
$output['form_status_message'] = \Lang::get('account_registration_completed_need_confirm');
} else {
$output['form_status'] = 'error';
$output['form_status_message'] = $result;
}
}
}
// re-populate form
$output['account_email'] = trim(\Input::post('account_email'));
}
// <head> output ----------------------------------------------------------------------------------------------
$output['page_title'] = $this->generateTitle(\Lang::get('account_resend_confirm_registration_email'));
// <head> output ----------------------------------------------------------------------------------------------
return $this->generatePage('front/templates/account/resendactivate_v', $output, false);
}
示例2: action_index
public function action_index()
{
// load language
\Lang::load('account');
// form submitted
if (\Input::method() == 'POST') {
$data['account_email'] = \Security::strip_tags(trim(\Input::post('account_email')));
// validate form.
$validate = \Validation::forge();
$validate->add('account_email', \Lang::get('account_email'), array(), array('required', 'valid_email'));
if (!\Extension\NoCsrf::check()) {
// validate token failed
$output['form_status'] = 'error';
$output['form_status_message'] = \Lang::get('fslang_invalid_csrf_token');
} elseif (!$validate->run()) {
// validate failed
$output['form_status'] = 'error';
$output['form_status_message'] = $validate->show_errors();
} else {
// validate pass
include APPPATH . 'vendor' . DS . 'securimage' . DS . 'securimage.php';
$securimage = new \Securimage();
if ($securimage->check(\Input::post('captcha')) == false) {
$output['form_status'] = 'error';
$output['form_status_message'] = \Lang::get('account_wrong_captcha_code');
} else {
$continue_form = true;
}
if (isset($continue_form) && $continue_form === true) {
// try to send reset password email
$result = \Model_Accounts::sendResetPasswordEmail($data);
if ($result === true) {
$output['hide_form'] = true;
$output['form_status'] = 'success';
$output['form_status_message'] = \Lang::get('account_please_check_your_email_to_confirm_reset_password');
} else {
if (is_string($result)) {
$output['form_status'] = 'error';
$output['form_status_message'] = $result;
}
}
}
}
// re-populate form
$output['account_email'] = trim(\Input::post('account_email'));
}
// <head> output ----------------------------------------------------------------------------------------------
$output['page_title'] = $this->generateTitle(\Lang::get('account_forgot_username_or_password'));
// <head> output ----------------------------------------------------------------------------------------------
return $this->generatePage('front/templates/account/forgotpw_v', $output, false);
}
示例3: friendly_title
/**
* Converts your text to a URL-friendly title so it can be used in the URL.
* Only works with UTF8 input and and only outputs 7 bit ASCII characters.
*
* @param string the text
* @param string the separator (either - or _)
* @return string the new title
*/
public static function friendly_title($str, $sep = '-', $lowercase = false)
{
// Allow underscore, otherwise default to dash
$sep = $sep === '_' ? '_' : '-';
// Remove tags
$str = \Security::strip_tags($str);
// Decode all entities to their simpler forms
$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
// Remove all quotes.
$str = preg_replace("#[\"\\']#", '', $str);
// Only allow 7bit characters
$str = static::ascii($str);
// Strip unwanted characters
$str = preg_replace("#[^a-z0-9]#i", $sep, $str);
$str = preg_replace("#[/_|+ -]+#", $sep, $str);
$str = trim($str, $sep);
if ($lowercase === true) {
$str = \Str::lower($str);
}
return $str;
}
示例4: friendly_title
/**
* Converts your text to a URL-friendly title so it can be used in the URL.
* Only works with UTF8 input and and only outputs 7 bit ASCII characters.
*
* @param string the text
* @param string the separator (either - or _)
* @return string the new title
*/
public static function friendly_title($str, $sep = '-', $lowercase = false)
{
// Allow underscore, otherwise default to dash
$sep = $sep != '_' ? '-' : $sep;
// Decode all entities to their simpler forms
$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
$trans = array('\\s+' => $sep, $sep . '+' => $sep, $sep . '$' => '', '^' . $sep => '', '\\.+$' => '');
foreach ($trans as $key => $val) {
$str = preg_replace("#" . $key . "#i", $val, $str);
}
// Only allow 7bit characters
$str = static::ascii($str);
$str = \Security::strip_tags($str);
if ($lowercase === true) {
$str = function_exists('mb_convert_case') ? mb_convert_case($str, MB_CASE_LOWER, 'UTF-8') : strtolower($str);
}
return $str;
}
示例5: action_viewlogins
public function action_viewlogins($account_id = '')
{
// set redirect url
$redirect = $this->getAndSetSubmitRedirection();
// check permission
if (\Model_AccountLevelPermission::checkAdminPermission('account_perm', 'account_viewlogin_log_perm') == false) {
\Session::set_flash('form_status', array('form_status' => 'error', 'form_status_message' => \Lang::get('admin_permission_denied', array('page' => \Uri::string()))));
\Response::redirect($redirect);
}
// viewing guest logins?
if ($account_id == '0') {
\Response::redirect($redirect);
}
// load language
\Lang::load('account');
\Lang::load('accountlogins');
// read flash message for display errors.
$form_status = \Session::get_flash('form_status');
if (isset($form_status['form_status']) && isset($form_status['form_status_message'])) {
$output['form_status'] = $form_status['form_status'];
$output['form_status_message'] = $form_status['form_status_message'];
}
unset($form_status);
// get accounts data for this account.
$account = \Model_Accounts::find($account_id);
if ($account == null) {
// not found account.
\Response::redirect($redirect);
}
$output['account'] = $account;
$output['account_id'] = $account_id;
unset($account);
// set sort variable for sortable in views.
$next_sort = \Security::strip_tags(trim(\Input::get('sort')));
if ($next_sort == null || $next_sort == 'DESC') {
$next_sort = 'ASC';
} else {
$next_sort = 'DESC';
}
$output['next_sort'] = $next_sort;
unset($next_sort);
// list logins -----------------------------------------------------------------------------------------------------
$option['limit'] = \Model_Config::getval('content_admin_items_perpage');
$option['offset'] = trim(\Input::get('page')) != null ? ((int) \Input::get('page') - 1) * $option['limit'] : 0;
if (\Security::strip_tags(trim(\Input::get('orders'))) != null) {
$option['orders'] = \Security::strip_tags(trim(\Input::get('orders')));
}
if (\Security::strip_tags(trim(\Input::get('sort'))) != null) {
$option['sort'] = \Security::strip_tags(trim(\Input::get('sort')));
}
$list_logins = \Model_AccountLogins::listLogins(array('account_id' => $account_id), $option);
// pagination config
$config['pagination_url'] = \Uri::main() . \Uri::getCurrentQuerystrings(true, true, false);
$config['total_items'] = $list_logins['total'];
$config['per_page'] = $option['limit'];
$config['uri_segment'] = 'page';
$config['num_links'] = 3;
$config['show_first'] = true;
$config['show_last'] = true;
$config['first-inactive'] = "\n\t\t<li class=\"disabled\">{link}</li>";
$config['first-inactive-link'] = '<a href="#">{page}</a>';
$config['first-marker'] = '«';
$config['last-inactive'] = "\n\t\t<li class=\"disabled\">{link}</li>";
$config['last-inactive-link'] = '<a href="#">{page}</a>';
$config['last-marker'] = '»';
$config['previous-marker'] = '‹';
$config['next-marker'] = '›';
$pagination = \Pagination::forge('viewlogins_pagination', $config);
$output['list_logins'] = $list_logins;
$output['pagination'] = $pagination;
unset($config, $list_logins, $option, $pagination);
// <head> output ----------------------------------------------------------------------------------------------
$output['page_title'] = $this->generateTitle(\Lang::get('account_view_login_history'));
// <head> output ----------------------------------------------------------------------------------------------
// breadcrumb -------------------------------------------------------------------------------------------------
$page_breadcrumb = [];
$page_breadcrumb[0] = ['name' => \Lang::get('admin_admin_home'), 'url' => \Uri::create('admin')];
$page_breadcrumb[1] = ['name' => \Lang::get('account_accounts'), 'url' => \Uri::create('admin/account')];
$page_breadcrumb[2] = ['name' => \Lang::get('account_view_login_history'), 'url' => \Uri::main()];
$output['page_breadcrumb'] = $page_breadcrumb;
unset($page_breadcrumb);
// breadcrumb -------------------------------------------------------------------------------------------------
return $this->generatePage('admin/templates/account/viewlogins_v', $output, false);
}
示例6: unable_del
/**
* Check if cat. CANNOT be deleted
*
* @param int $id cat. id
* @return array $relatedcat names of related cat.s if the cat. CANNOT be deleted,
* boolean FALSE if the cat. CAN be deleted
*
* @access protected
* @author Nguyen Van Hiep
*/
protected function unable_del($id)
{
$relatedcats = array();
$relatedarts = array();
$cats = Model_Categories::get_child_cats($id);
$cat_arts = Model_ArtCat::get_related_articles($id);
foreach ($cats as $item) {
$text = Security::clean($item->name, array('htmlentities', 'xss_clean'));
$relatedcats[] = Html::anchor('/admin/categories/edit/' . $item->id, $text);
}
if (count($relatedcats) > 0) {
array_unshift($relatedcats, '- ' . __('cat.categories') . ':');
}
foreach ($cat_arts as $art) {
$text = Security::strip_tags($art->ac2a->title);
$relatedarts[] = Html::anchor('/admin/article/edit/' . $art->art_id, $text);
}
if (count($relatedarts) > 0) {
array_unshift($relatedarts, '- ' . __('art.arts') . ':');
}
$ret = array_merge($relatedcats, $relatedarts);
if (count($ret) > 0) {
return $ret;
} else {
return false;
}
}
示例7: friendly_title
/**
* Converts your text to a URL-friendly title so it can be used in the URL.
* Only works with UTF8 input and and only outputs 7 bit ASCII characters.
*
* @param string the text
* @param string the separator (either - or _)
* @return string the new title
*/
public static function friendly_title($str, $sep = '-', $lowercase = false)
{
// Allow underscore, otherwise default to dash
$sep = $sep != '_' ? '-' : $sep;
// Decode all entities to their simpler forms
$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
$trans = array(
'\s+' => $sep, // one or more spaces => seperator
$sep.'+' => $sep, // multiple seperators => 1 seperator
$sep.'$' => '', // ending seperator => (nothing)
'^'.$sep => '', // starting seperator => (nothing)
'\.+$' => '', // ending dot => (nothing)
'\?' => '' // question mark
);
foreach ($trans as $key => $val)
{
$str = preg_replace("#".$key."#i", $val, $str);
}
// Only allow 7bit characters
$str = static::ascii($str);
$str = \Security::strip_tags($str);
if ($lowercase === true)
{
$str = \Str::lower($str);
}
return $str;
}
示例8: action_index
public function action_index()
{
// load language
\Lang::load('account');
// is user logged in?
if (\Model_Accounts::isMemberLogin() == false) {
\Response::redirect(\Uri::create('account/login') . '?rdr=' . urlencode(\Uri::main()));
}
// load config from db.
$cfg_values = array('allow_avatar', 'avatar_size', 'avatar_allowed_types');
$config = \Model_Config::getvalues($cfg_values);
$output['config'] = $config;
// set config data to display in view file.
$output['allow_avatar'] = $config['allow_avatar']['value'];
$output['avatar_size'] = $config['avatar_size']['value'];
$output['avatar_allowed_types'] = $config['avatar_allowed_types']['value'];
unset($cfg_values);
// read flash message for display errors. this is REQUIRED if you coding the check login with simultaneous login detection on.
$form_status = \Session::get_flash('form_status');
if (isset($form_status['form_status']) && isset($form_status['form_status_message'])) {
$output['form_status'] = $form_status['form_status'];
$output['form_status_message'] = $form_status['form_status_message'];
}
unset($form_status);
// get account id
$cookie_account = \Model_Accounts::forge()->getAccountCookie();
// get account data
$query = \Model_Accounts::query()->where('account_id', $cookie_account['account_id'])->where('account_username', $cookie_account['account_username'])->where('account_email', $cookie_account['account_email']);
if ($query->count() > 0) {
// found
$row = $query->get_one();
$output['row'] = $row;
// loop set data for display in form.
foreach ($row as $key => $field) {
$output[$key] = $field;
}
// get account_fields data of current user and send to views form
// to access data from view, use $account_field['field_name']. for example: the field_name is phone, just use $account_field['phone'];
$account_fields = \Model_AccountFields::getData($cookie_account['account_id']);
if ($account_fields->count() > 0) {
foreach ($account_fields as $af) {
$output['account_field'][$af->field_name] = \Extension\Str::isJsonFormat($af->field_value) ? json_decode($af->field_value, true) : $af->field_value;
}
}
unset($account_fields, $af);
// get timezone list to display.
\Config::load('timezone', 'timezone');
$output['timezone_list'] = \Config::get('timezone.timezone', array());
unset($query);
} else {
// not found account.
unset($cookie_account, $query);
\Model_Accounts::logout();
\Response::redirect(\Uri::create('account/login') . '?rdr=' . urlencode(\Uri::main()));
}
// if form submitted
if (\Input::method() == 'POST') {
// store data for save to db.
$data['account_id'] = $cookie_account['account_id'];
$data['account_username'] = $cookie_account['account_username'];
//trim(\Input::post('account_username'));//no, do not edit username.
$data['account_old_email'] = $cookie_account['account_email'];
$data['account_email'] = \Security::strip_tags(trim(\Input::post('account_email')));
$data['account_password'] = trim(\Input::post('account_password'));
$data['account_new_password'] = trim(\Input::post('account_new_password'));
$data['account_display_name'] = \Security::htmlentities(\Input::post('account_display_name'));
$data['account_firstname'] = \Security::htmlentities(trim(\Input::post('account_firstname', null)));
if ($data['account_firstname'] == null) {
$data['account_firstname'] = null;
}
$data['account_middlename'] = \Security::htmlentities(trim(\Input::post('account_middlename', null)));
if ($data['account_middlename'] == null) {
$data['account_middlename'] = null;
}
$data['account_lastname'] = \Security::htmlentities(trim(\Input::post('account_lastname', null)));
if ($data['account_lastname'] == null) {
$data['account_lastname'] = null;
}
$data['account_birthdate'] = \Security::strip_tags(trim(\Input::post('account_birthdate', null)));
if ($data['account_birthdate'] == null) {
$data['account_birthdate'] = null;
}
$data['account_signature'] = \Security::htmlentities(trim(\Input::post('account_signature', null)));
if ($data['account_signature'] == null) {
$data['account_signature'] = null;
}
$data['account_timezone'] = \Security::strip_tags(trim(\Input::post('account_timezone')));
$data['account_language'] = \Security::strip_tags(trim(\Input::post('account_language', null)));
if ($data['account_language'] == null) {
$data['account_language'] = null;
}
// store data for account_fields
$data_field = array();
if (is_array(\Input::post('account_field'))) {
foreach (\Input::post('account_field') as $field_name => $field_value) {
if (is_string($field_name)) {
if (is_array($field_value)) {
$field_value = json_encode($field_value);
}
$data_field[$field_name] = $field_value;
//.........这里部分代码省略.........
示例9: get_timeline_content
public static function get_timeline_content($timeline_id, $type, $body = null, $foreign_table_obj = null, array $optional_info = null, $is_detail = false, $is_strip_tags = false)
{
switch ($type) {
case \Config::get('timeline.types.normal'):
// 通常 timeline 投稿(つぶやき)
// 通常 timeline 投稿(つぶやき)
case \Config::get('timeline.types.album_image_timeline'):
case \Config::get('timeline.types.member_name'):
$return_body = self::get_normal_timeline_body($body, $type, $timeline_id, isset($optional_info['count']) ? $optional_info['count'] : 0, $is_detail);
return $is_strip_tags ? \Security::strip_tags($return_body) : $return_body;
case \Config::get('timeline.types.member_register'):
// SNS への参加
return FBD_SITE_NAME . ' に参加しました。';
case \Config::get('timeline.types.profile_image'):
// profile 写真投稿
// profile 写真投稿
case \Config::get('timeline.types.album_image_profile'):
// profile 写真投稿(album_image)
return term('profile', 'site.picture') . 'を設定しました。';
case \Config::get('timeline.types.note'):
// note 投稿
return term('note') . 'を投稿しました。';
case \Config::get('timeline.types.thread'):
// thread 投稿
return term('thread') . 'を投稿しました。';
case \Config::get('timeline.types.album'):
// album 作成
return term('album') . 'を作成しました。';
case \Config::get('timeline.types.album_image'):
// album_image 投稿
$return_body = $foreign_table_obj ? render('timeline::_parts/body_for_add_album_image', array('album_id' => $foreign_table_obj->id, 'name' => $foreign_table_obj->name, 'count' => isset($optional_info['count']) ? $optional_info['count'] : 0)) : null;
return $is_strip_tags ? \Security::strip_tags($return_body) : $return_body;
//case \Config::get('timeline.types.member_name'):// ニックネーム変更
// break;
}
return null;
}
示例10: action_index
public function action_index()
{
// clear redirect referrer
\Session::delete('submitted_redirect');
// check permission
if (\Model_AccountLevelPermission::checkAdminPermission('siteman_perm', 'siteman_viewsites_perm') == false) {
\Session::set_flash('form_status', array('form_status' => 'error', 'form_status_message' => \Lang::get('admin_permission_denied', array('page' => \Uri::string()))));
\Response::redirect(\Uri::create('admin'));
}
// read flash message for display errors.
$form_status = \Session::get_flash('form_status');
if (isset($form_status['form_status']) && isset($form_status['form_status_message'])) {
$output['form_status'] = $form_status['form_status'];
$output['form_status_message'] = $form_status['form_status_message'];
}
unset($form_status);
// set sort variable for sortable in views.
$next_sort = \Security::strip_tags(trim(\Input::get('sort')));
if ($next_sort == null || $next_sort == 'ASC') {
$next_sort = 'DESC';
} else {
$next_sort = 'ASC';
}
$output['next_sort'] = $next_sort;
unset($next_sort);
// filters
$output['filter_site_id'] = trim(\Input::get('filter_site_id'));
$output['filter_site_name'] = trim(\Input::get('filter_site_name'));
$output['filter_site_domain'] = trim(\Input::get('filter_site_domain'));
$output['filter_site_status'] = trim(\Input::get('filter_site_status'));
// list sites ------------------------------------------------------------------------------------------------------
$option['list_for'] = 'admin';
$option['limit'] = \Model_Config::getval('content_admin_items_perpage');
$option['offset'] = trim(\Input::get('page')) != null ? ((int) \Input::get('page') - 1) * $option['limit'] : 0;
if ($output['filter_site_id'] != null) {
$option['filter_site_id'] = $output['filter_site_id'];
}
if ($output['filter_site_name'] != null) {
$option['filter_site_name'] = $output['filter_site_name'];
}
if ($output['filter_site_domain'] != null) {
$option['filter_site_domain'] = $output['filter_site_domain'];
}
if ($output['filter_site_status'] != null) {
$option['filter_site_status'] = $output['filter_site_status'];
}
if (\Security::strip_tags(trim(\Input::get('orders'))) != null) {
$option['orders'] = \Security::strip_tags(trim(\Input::get('orders')));
}
if (\Security::strip_tags(trim(\Input::get('sort'))) != null) {
$option['sort'] = \Security::strip_tags(trim(\Input::get('sort')));
}
$list_sites = \Model_Sites::listSites($option);
// pagination config
$config['pagination_url'] = \Uri::main() . \Uri::getCurrentQuerystrings(true, true, false);
$config['total_items'] = $list_sites['total'];
$config['per_page'] = $option['limit'];
$config['uri_segment'] = 'page';
$config['num_links'] = 3;
$config['show_first'] = true;
$config['show_last'] = true;
$config['first-inactive'] = "\n\t\t<li class=\"disabled\">{link}</li>";
$config['first-inactive-link'] = '<a href="#">{page}</a>';
$config['first-marker'] = '«';
$config['last-inactive'] = "\n\t\t<li class=\"disabled\">{link}</li>";
$config['last-inactive-link'] = '<a href="#">{page}</a>';
$config['last-marker'] = '»';
$config['previous-marker'] = '‹';
$config['next-marker'] = '›';
$pagination = \Pagination::forge('default', $config);
$output['list_sites'] = $list_sites;
$output['pagination'] = $pagination;
unset($config, $list_accounts, $option, $pagination);
// <head> output ----------------------------------------------------------------------------------------------
$output['page_title'] = $this->generateTitle(\Lang::get('siteman_multisite_manager'));
// <head> output ----------------------------------------------------------------------------------------------
// breadcrumb -------------------------------------------------------------------------------------------------
$page_breadcrumb = [];
$page_breadcrumb[0] = ['name' => \Lang::get('admin_admin_home'), 'url' => \Uri::create('admin')];
$page_breadcrumb[1] = ['name' => \Lang::get('siteman_multisite_manager'), 'url' => \Uri::create('admin/siteman')];
$output['page_breadcrumb'] = $page_breadcrumb;
unset($page_breadcrumb);
// breadcrumb -------------------------------------------------------------------------------------------------
return $this->generatePage('admin/templates/siteman/index_v', $output, false);
}
示例11: action_save
public function action_save($account_id = '')
{
// set redirect url
$redirect = $this->getAndSetSubmitRedirection();
// check permission
if (\Model_AccountLevelPermission::checkAdminPermission('acperm_perm', 'acperm_manage_user_perm') == false) {
\Session::set_flash('form_status', array('form_status' => 'error', 'form_status_message' => \Lang::get('admin_permission_denied', array('page' => \Uri::string()))));
\Response::redirect($redirect);
}
// if account id not set
if (!is_numeric($account_id)) {
$cookie_account = \Model_Accounts::forge()->getAccountCookie('admin');
$account_id = 0;
if (isset($cookie_account['account_id'])) {
$account_id = $cookie_account['account_id'];
}
unset($cookie_account);
}
$output['account_id'] = $account_id;
// check target account
$account_check_result = $this->checkAccountData($account_id);
$output['account_check_result'] = is_object($account_check_result) || is_array($account_check_result) ? true : $account_check_result;
unset($account_check_result);
if ($output['account_check_result'] === true) {
// if form submitted
if (\Input::method() == 'POST') {
if (\Extension\NoCsrf::check()) {
$data['permission_core'] = (int) trim(\Input::post('permission_core'));
if ($data['permission_core'] != '1') {
$data['permission_core'] = '0';
}
$data['module_system_name'] = \Security::strip_tags(trim(\Input::post('module_system_name')));
if ($data['module_system_name'] == null || $data['permission_core'] == '1') {
$data['module_system_name'] = null;
}
$data['account_id'] = \Input::post('account_id');
$data['permission_page'] = \Input::post('permission_page');
$data['permission_action'] = \Input::post('permission_action');
\Model_AccountPermission::savePermissions($account_id, $data);
// set success message
\Session::set_flash('form_status', array('form_status' => 'success', 'form_status_message' => \Lang::get('admin_saved')));
} else {
// nocsrf error, set error msg.
\Session::set_flash('form_status', array('form_status' => 'error', 'form_status_message' => \Lang::get('fslang_invalid_csrf_token')));
}
// endif nocsrf check
}
// endif form submitted
} else {
// failed to check account. set error msg.
\Session::set_flash('form_status', array('form_status' => 'error', 'form_status_message' => $output['account_check_result']));
}
// endif check account result.
// go back
\Response::redirect($redirect);
}
示例12: action_save
public function action_save()
{
// set redirect url
$redirect = $this->getAndSetSubmitRedirection();
// check permission
if (\Model_AccountLevelPermission::checkAdminPermission('acperm_perm', 'acperm_manage_level_perm') == false) {
\Session::set_flash('form_status', array('form_status' => 'error', 'form_status_message' => \Lang::get('admin_permission_denied', array('page' => \Uri::string()))));
\Response::redirect($redirect);
}
// if form submitted
if (\Input::method() == 'POST') {
if (\Extension\NoCsrf::check()) {
$data['permission_core'] = (int) trim(\Input::post('permission_core'));
if ($data['permission_core'] != '1') {
$data['permission_core'] = '0';
}
$data['module_system_name'] = \Security::strip_tags(trim(\Input::post('module_system_name')));
if ($data['module_system_name'] == null || $data['permission_core'] == '1') {
$data['module_system_name'] = null;
}
$data['level_group_id'] = \Input::post('level_group_id');
$data['permission_page'] = \Input::post('permission_page');
$data['permission_action'] = \Input::post('permission_action');
\Model_AccountLevelPermission::savePermissions($data);
// set success message
\Session::set_flash('form_status', array('form_status' => 'success', 'form_status_message' => \Lang::get('admin_saved')));
} else {
// nocsrf error, set error msg.
\Session::set_flash('form_status', array('form_status' => 'error', 'form_status_message' => \Lang::get('fslang_invalid_csrf_token')));
}
}
// go back
\Response::redirect($redirect);
}
示例13: action_index
public function action_index()
{
// is user logged in?
if (\Model_Accounts::isMemberLogin() == false) {
\Response::redirect(\Uri::create('account/login') . '?rdr=' . urlencode(\Uri::main()));
}
// load language
\Lang::load('account');
\Lang::load('accountlogins');
// get account id
$cookie_account = \Model_Accounts::forge()->getAccountCookie();
// get account data
$row = \Model_Accounts::find($cookie_account['account_id']);
if ($row == null) {
// not found user data.
unset($row);
\Response::redirect(\Uri::main());
}
$output['account'] = $row;
// set sort variable for sortable in views.
$next_sort = \Security::strip_tags(trim(\Input::get('sort')));
if ($next_sort == null || $next_sort == 'DESC') {
$next_sort = 'ASC';
} else {
$next_sort = 'DESC';
}
$output['next_sort'] = $next_sort;
unset($next_sort);
// list logins -----------------------------------------------------------------------------------------------------
$option['limit'] = \Model_Config::getval('content_items_perpage');
$option['offset'] = trim(\Input::get('page')) != null ? ((int) \Input::get('page') - 1) * $option['limit'] : 0;
if (\Security::strip_tags(trim(\Input::get('orders'))) != null) {
$option['orders'] = \Security::strip_tags(trim(\Input::get('orders')));
}
if (\Security::strip_tags(trim(\Input::get('sort'))) != null) {
$option['sort'] = \Security::strip_tags(trim(\Input::get('sort')));
}
$data['account_id'] = $cookie_account['account_id'];
$data['site_id'] = \Model_Sites::getSiteId();
$list_logins = \Model_AccountLogins::listLogins($data, $option);
// pagination config
$config['pagination_url'] = \Uri::main() . \Uri::getCurrentQuerystrings(true, true, false);
$config['total_items'] = $list_logins['total'];
$config['per_page'] = $option['limit'];
$config['uri_segment'] = 'page';
$config['num_links'] = 3;
$config['show_first'] = true;
$config['show_last'] = true;
$config['first-inactive'] = "\n\t\t<li class=\"disabled\">{link}</li>";
$config['first-inactive-link'] = '<a href="#">{page}</a>';
$config['first-marker'] = '«';
$config['last-inactive'] = "\n\t\t<li class=\"disabled\">{link}</li>";
$config['last-inactive-link'] = '<a href="#">{page}</a>';
$config['last-marker'] = '»';
$config['previous-marker'] = '‹';
$config['next-marker'] = '›';
$pagination = \Pagination::forge('viewlogins_pagination', $config);
$output['list_logins'] = $list_logins;
$output['pagination'] = $pagination;
unset($config, $data, $list_logins, $option, $pagination);
// <head> output ----------------------------------------------------------------------------------------------
$output['page_title'] = $this->generateTitle(\Lang::get('account_login_history'));
// <head> output ----------------------------------------------------------------------------------------------
return $this->generatePage('front/templates/account/viewlogins_v', $output, false);
}
示例14: foreach
<div style="text-align: center">
<?php
foreach ($arts as $art) {
?>
<div class="portfolio sanpham-cat-3col custom-backround" style="display: inline-block;
background-image: url('<?php
echo URI::base() . 'assets/img/art/' . $art['thumb'];
?>
')">
<a href="<?php
echo URI::base() . 'assets/img/art/' . $art['thumb'];
?>
" class="b-link-stripe b-animate-go swipebox"
style="width: 100%; height: 100%; position: absolute; left: 0;"
title="<?php
echo !empty($art['desc']) ? Security::strip_tags(htmlspecialchars_decode($art['desc'])) : '...';
?>
">
</a>
</div>
<?php
}
?>
<div class="clear"></div>
</div>
</div>
示例15: url
?>
<div class="you-box-col col-md-6 col-sm-6 col-6-mobile portfolio-item wow animated zoomIn custom-backround" style="padding:0px; height: 400px;
background-image: url('<?php
echo URI::base() . 'assets/img/cat/' . $left_cat['bg'];
?>
')">
<div class="portfolio-link" data-toggle="modal" style="width: 100%; height: 100%;">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<div class="row inner_boxx you-title">
<div class="col-lg-12 text-center">
<?php
echo htmlspecialchars_decode($left_cat['name']);
?>
<h3 class="section-subheading you-text ve-chung-toi"><?php
echo Input::cut_strings(Security::strip_tags(htmlspecialchars_decode($left_cat['desc'])), 90);
?>
</h3>
<a href="<?php
echo Uri::base() . 'you/' . $left_cat['slug'] . '.html';
?>
" class="portfolio-link cat-modal btn btn-warning you-button-view-profile" data-toggle="modal" >
<?php
echo __('common.view_our_profile');
?>
</a>
</div>
</div>
</div>