本文整理汇总了PHP中Zend_Filter_StripTags类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Filter_StripTags类的具体用法?PHP Zend_Filter_StripTags怎么用?PHP Zend_Filter_StripTags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Filter_StripTags类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: agregarAction
function agregarAction()
{
$this->view->subtitle = $this->info->sitio->contacto->agregar->titulo;
$this->view->contacto = new stdClass();
$this->view->action = $this->info->sitio->usuarios->agregar->action;
$this->view->buttonText = $this->info->sitio->contacto->agregar->buttonText;
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
$this->view->contacto->nombre = trim($filter->filter($this->_request->getPost('nombre')));
$this->view->contacto->email = trim($filter->filter($this->_request->getPost('email')));
$this->view->contacto->comentario = trim($filter->filter($this->_request->getPost('comentario')));
$this->view->contacto->telefono = trim($filter->filter($this->_request->getPost('telefono')));
$fecha = date("Y-m-d H:i:s");
if ($this->view->contacto->nombre != '' && $this->view->contacto->email != '' && $this->view->contacto->comentario != '' && $this->view->contacto->telefono != '') {
$data = array('nombre' => $this->view->contacto->nombre, 'email' => $this->view->contacto->email, 'comentario' => $this->view->contacto->comentario, 'telefono' => $this->view->contacto->telefono, 'fecha' => $fecha, 'id_sitio' => $this->session->sitio->id);
$contacto = new Contacto();
$contacto->insert($data);
//Enviamos el correo.
$destinatario = $this->view->contacto->email;
$asunto = $this->info->sitio->contacto->add->asunto;
$cuerpo = $this->view->contacto->nombre . " " . $this->view->contacto->comentario;
$headers = $this->info->sitio->contacto->add->sender;
mail($destinatario, $asunto, $cuerpo, $headers);
$this->view->message = " El comentario fue enviado con exito ! Muchas gracias.";
$this->view->buttonText = $this->info->sitio->contacto->agregar->buttonText;
return;
} else {
$this->view->message = "Deben completar todos los campos";
}
}
$this->render();
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:33,代码来源:ContactoController.php
示例2: loginAction
function loginAction()
{
$this->view->login_redirect = webconfig::getContestRelativeBaseUrl();
$this->view->message = "";
if ($this->_request->isPost()) {
// collect the data from the user
Zend_Loader::loadClass('Zend_Filter_StripTags');
$f = new Zend_Filter_StripTags();
$username = $f->filter($this->_request->getPost('username'));
$password = $f->filter($this->_request->getPost('password'));
if (empty($username)) {
$this->view->login_message = 'Please provide a username.';
} else {
$authAdapter = new MyAuthAdapter($username, $password);
Zend_Loader::loadClass('Zend_Auth');
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
$this->log->info($auth->getIdentity() . " has logged on.");
$this->_redirect($this->_request->get("redirectto"));
} else {
$this->view->login_message = 'Login failed.';
}
}
}
$this->view->title = "Log In";
}
开发者ID:rajatkhanduja,项目名称:opc,代码行数:27,代码来源:AuthController.php
示例3: indexAction
public function indexAction()
{
$filter = new Zend_Filter_StripTags();
$login = trim($filter->filter($this->_request->getPost('login')));
$senha = trim($filter->filter($this->_request->getPost('senha')));
$uri = str_replace('kahina/', '', base64_decode($this->_request->getParam('u', base64_encode('painel/index'))));
if (empty($login) || empty($senha)) {
$this->view->message = 'Por favor, informe seu Usuário e Senha.';
return;
} else {
$dbAdapter = Zend_Db_Table_Abstract::getDefaultAdapter();
$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
$authAdapter->setTableName('login')->setIdentityColumn('login')->setCredentialColumn('senha');
$authAdapter->setIdentity($this->_getParam('login'))->setCredential($this->_getParam('senha'))->setCredentialTreatment('MD5(?)');
$result = $authAdapter->authenticate();
if ($result->isValid()) {
$user = $authAdapter->getResultRowObject();
$storage = My_Auth::getInstance('Painel')->getStorage();
$storage->write($user);
$this->_redirect($uri);
} else {
$this->view->error = 'Você deve informar Login e Senha.';
}
}
$this->render();
}
开发者ID:agenciaaeh,项目名称:kahina,代码行数:26,代码来源:AuthController.php
示例4: loginAction
function loginAction()
{
$this->view->message = '';
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$f = new Zend_Filter_StripTags();
$username = $f->filter($this->_request->getPost('username'));
$password = md5($f->filter($this->_request->getPost('password')));
if (!empty($username)) {
Zend_Loader::loadClass('Zend_Auth_Adapter_DbTable');
$dbAdapter = Zend_Registry::get('dbAdapter');
$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
$authAdapter->setTableName('utilisateur');
$authAdapter->setIdentityColumn('login_utilisateur');
$authAdapter->setCredentialColumn('pass_utilisateur');
$authAdapter->setIdentity($username);
$authAdapter->setCredential($password);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
$data = $authAdapter->getResultRowObject(null, 'password');
$auth->getStorage()->write($data);
$this->_redirect('/');
}
}
$this->_redirect('auth/loginfail');
}
}
开发者ID:Zabu,项目名称:MTA,代码行数:28,代码来源:AuthController.php
示例5: modificarAction
public function modificarAction()
{
$this->view->subtitle = $this->info->sitio->faqs->modificar->titulo;
$eFAQ = new Faqs();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
$id = (int) $this->_request->getPost('id');
$pregunta = trim($filter->filter($this->_request->getPost('pregunta')));
$respuesta = trim($filter->filter($this->_request->getPost('respuesta')));
if ($id !== false) {
if ($pregunta != '' && $respuesta != '') {
$data = array('pregunta' => $pregunta, 'respuesta' => $respuesta, 'id_sitio' => $this->session->sitio->id);
$where = 'id = ' . $id;
$eFAQ->update($data, $where);
$this->_redirect('/admin/faqs/');
return;
} else {
$this->view->faq = $eFAQ->fetchRow('id=' . $id);
}
}
} else {
$id = (int) $this->_request->getParam('id', 0);
if ($id > 0) {
$this->view->faq = $eFAQ->fetchRow('id=' . $id);
}
}
$this->view->action = $this->info->sitio->faqs->modificar->action;
$this->view->buttonText = $this->info->sitio->faqs->modificar->buttonText;
$this->render();
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:31,代码来源:FaqsController.php
示例6: agregarAction
public function agregarAction()
{
$this->view->buttonText = $this->info->sitio->paginas->agregar->buttonText;
$this->view->subtitle = $this->info->sitio->menus->agregar->titulo;
$this->view->id_pagina = (int) $this->_request->getParam('pagina');
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
$id_pagina = (int) $this->_request->getPost('id_pagina');
$id_menu = (int) $this->_request->getPost('id_menu');
$link = $this->_request->getPost('link');
$titulo = trim($filter->filter($this->_request->getPost('titulo')));
$alt = $this->_request->getPost('alt');
if ($titulo != '' && $link != '') {
$data = array('titulo' => $titulo, 'id_pagina' => $id_pagina, 'id_menu' => $id_menu, 'link' => $link, 'alt' => $alt);
$menupag = new PaginasMenu();
$menupag->insert($data);
$this->_redirect(self::RETORNO . $id_pagina);
return;
}
}
$this->view->menupag = new stdClass();
$this->view->menupag->id_menu = null;
$this->view->menupag->id_pagina = $this->view->id_pagina;
$this->view->menupag->titulo = '';
$this->view->menupag->link = '';
$this->view->menupag->alt = '';
$this->view->action = "agregar";
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:29,代码来源:MenupagController.php
示例7: init
public function init()
{
$request = $this->getRequest();
// action name based category
$action = $request->getActionName();
$this->page = (int) $request->getParam('page');
if ($this->page < 1) {
$this->page = 1;
}
$url_search_term = trim($this->getRequest()->getParam('term', false));
if ($url_search_term !== false) {
// filter search input
$filter_st = new Zend_Filter_StripTags();
$url_search_term = $filter_st->filter($url_search_term);
$this->search_term = $url_search_term;
}
// minimum search string
$min = 3;
if ($url_search_term && strlen($this->search_term) < $min) {
$this->search_term = '';
Application_Plugin_Alerts::error($this->view->translate('Search query to short'), 'off');
}
// set global search form action & value
$this->view->search_category = $action;
$this->view->search_term = $this->search_term;
// now that we have search_term we can build a menu
$this->buildMenu();
}
开发者ID:georgepaul,项目名称:songslikesocial,代码行数:28,代码来源:SearchController.php
示例8: modificarAction
public function modificarAction()
{
$this->view->subtitle = 'Modificar';
$archivos = new Archivos();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
$id = (int) $this->_request->getPost('id');
$descripcion = trim($filter->filter($this->_request->getPost('descripcion')));
if ($id !== false) {
if ($descripcion != '') {
$data = array('descripcion' => $descripcion);
$where = 'id = ' . $id;
$archivos->update($data, $where);
$this->_redirect('/admin/archivos/');
return;
} else {
$this->view->archivo = $archivo->fetchRow('id=' . $id);
$this->view->message = "Deben llenarse todos los campos";
}
}
} else {
$id = (int) $this->_request->getParam('id', 0);
if ($id > 0) {
$this->view->archivo = $archivos->fetchRow('id=' . $id);
}
}
$this->view->action = "modificar";
$this->view->buttonText = "Modificar";
$this->view->scriptJs = "lightbox";
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:31,代码来源:ArchivosController.php
示例9: init
public function init()
{
$stripTags = new Zend_Filter_StripTags();
$stripTags->setTagsAllowed(array('p', 'a', 'img', 'strong', 'b', 'i', 'em', 's', 'del'));
$stripTags->setAttributesAllowed(array('href', 'target', 'rel', 'name', 'src', 'width', 'height', 'alt', 'title'));
$this->addElement('textarea', 'description', array('class' => 'richedit', 'label' => 'Description:', 'required' => true, 'filters' => array('StringTrim', $stripTags), 'validators' => array(new Zend_Validate_NotEmpty())))->addElement('hidden', 'recipe_id')->addElement('submit', 'submit');
}
开发者ID:vishaleyes,项目名称:cookingwithzend,代码行数:7,代码来源:Method.php
示例10: indexAction
public function indexAction()
{
$this->view->headTitle("创建项目");
if ($this->getRequest()->isPost()) {
$filter = new Zend_Filter_StripTags();
$name = $filter->filter(trim($this->_request->getParam('name')));
$pwd = $filter->filter(trim($this->_request->getParam('pwd')));
$confirmpwd = $filter->filter(trim($this->_request->getParam('confirmpwd')));
$email = $filter->filter(trim($this->_request->getParam('email')));
$issue_time = date('Y-m-d H:i:s', time());
if ($this->getRequest()->isXmlHttpRequest() || $this->_request->getParam('ajax') == 1) {
$project = new Application_Model_DbTable_Project();
$lastinsret_id = $project->addProject($name, $pwd, $email, $issue_time);
if ($lastinsret_id) {
if ($this->createFile($name, $lastinsret_id)) {
$status = "ok";
$response = "恭喜您,注册成功!";
$user = new Zend_Session_Namespace('user');
$user->name = $name;
} else {
$status = "sorry";
$response = "抱歉! 系统出错,请稍后再试!";
}
} else {
$status = "sorry";
$response = "抱歉! 系统出错,请稍后再试!";
}
$res = '{"status":"' . $status . '","name":"' . $name . '"}';
$this->_helper->layout->setLayout('empty_layout');
$this->_helper->viewRenderer->setNoRender();
$this->_response->appendBody($res);
}
}
}
开发者ID:BGCX262,项目名称:zwh-web-svn-to-git,代码行数:34,代码来源:RegisterController.php
示例11: indexAction
public function indexAction()
{
$this->view->headTitle("uiwiki-登陆");
if ($this->getRequest()->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
//表单的post值
$name = $filter->filter($this->_request->getPost('name'));
$password = $filter->filter($this->_request->getPost('password'));
if (!empty($name)) {
$authAdapter = new Zend_Auth_Adapter_DbTable();
$authAdapter->setTableName('ui_project')->setIdentityColumn('name')->setCredentialColumn('password')->setIdentity($name)->setCredential($password);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
// 执行认证查询,并保存结果
if ($result->isValid()) {
$data = $authAdapter->getResultRowObject(array('name', 'id'));
if ($auth->hasIdentity()) {
//auth之后写入session
$user = new Zend_Session_Namespace('user');
$user->name = $data->name;
$user->id = $data->id;
$user->setExpirationSeconds(6000);
//命名空间 "user" 将在第一次访问后 6000 秒过期
//echo '<h3><font color=red> 登录成功!</font></h3>';
$this->_redirect('/' . $name);
}
} else {
echo '<h3><font color=red> 登录失败,请重新登录!</font></h3>';
}
}
}
}
开发者ID:BGCX262,项目名称:zwh-web-svn-to-git,代码行数:33,代码来源:IndexController.php
示例12: login
public function login($username, $password)
{
$ret = false;
$filter = new Zend_Filter_StripTags();
$username = $filter->filter($username);
$password = $filter->filter($password);
if (isset($username) && isset($password)) {
$db = Das_Db::factory();
$authAdapter = new Zend_Auth_Adapter_DbTable($db);
$authAdapter->setTableName('v9_user');
$authAdapter->setIdentityColumn('username');
$authAdapter->setCredentialColumn('password');
$authAdapter->setIdentity($username);
$authAdapter->setCredential($password);
$result = $this->auth->authenticate($authAdapter);
if ($result->isValid()) {
$storage = $this->auth->getStorage();
// $retObj = $authAdapter->getResultRowObject();
// $storage->write($retObj->group_id);
$storage->write($authAdapter->getResultRowObject());
$ret = true;
}
}
return $ret;
}
开发者ID:baowzh,项目名称:renfangbaosong,代码行数:25,代码来源:Login.php
示例13: modificarAction
function modificarAction()
{
$this->view->subtitle = "Modificar Configuración";
$configuracion = new Configuracion();
if ($this->_request->isPost()) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
$id = (int) $this->_request->getPost('id');
$sitio_color_fondo = trim($filter->filter($this->_request->getPost('sitio_color_fondo')));
$sitio_color_cabezal = trim($filter->filter($this->_request->getPost('sitio_color_cabezal')));
$sitio_color_pie = trim($filter->filter($this->_request->getPost('sitio_color_pie')));
if ($id !== false) {
$data = array('sitio_color_fondo' => $sitio_color_fondo, 'sitio_color_cabezal' => $sitio_color_cabezal, 'sitio_color_pie' => $sitio_color_pie, 'id_sitio' => $this->session->sitio->id);
$where = 'id = ' . $id;
$configuracion->update($data, $where);
$this->_redirect('/admin/configuracion/');
return;
}
} else {
$id = (int) $this->_request->getParam('id', 0);
if ($id > 0) {
$this->view->configuracion = Configuracion::getConfiguracionSitio($id);
}
}
$this->view->action = "modificar";
$this->view->buttonText = "Modificar";
$this->view->scriptJs = "mooRainbow";
}
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:28,代码来源:ConfiguracionController.php
示例14: indexAction
/**
* The default action - show the contact form
*/
public function indexAction()
{
$request = $this->getRequest();
$form = $this->_getContactForm();
// check to see if this action has been POST'ed to
if ($this->getRequest()->isPost()) {
// now check to see if the form submitted exists, and
// if the values passed in are valid for this form
if ($form->isValid($request->getPost())) {
// collect the data from the user
$f = new Zend_Filter_StripTags();
$email = $f->filter($this->_request->getPost('email'));
$message = $f->filter($this->_request->getPost('message'));
//get the username if its nolotiro user
$user_info = $this->view->user->username;
$user_info .= $_SERVER['REMOTE_ADDR'];
$user_info .= ' ' . $_SERVER['HTTP_USER_AGENT'];
$mail = new Zend_Mail('utf-8');
$body = $user_info . '<br/>' . $message;
$mail->setBodyHtml($body);
$mail->setFrom($email);
$mail->addTo('[email protected]', 'aLabs');
$mail->setSubject('nolotiro.org - contact from ' . $email);
$mail->send();
$this->_helper->_flashMessenger->addMessage($this->view->translate('Message sent successfully!'));
$this->_redirect('/' . $this->lang . '/woeid/' . $this->location . '/give');
}
}
$this->view->form = $form;
}
开发者ID:Arteaga2k,项目名称:nolotiro,代码行数:33,代码来源:ContactController.php
示例15: loginAction
function loginAction()
{
if ($this->_request->isPost('log-form')) {
Zend_Loader::loadClass('Zend_Filter_StripTags');
$filter = new Zend_Filter_StripTags();
$username = trim($filter->filter($this->_request->getPost('log-name')));
$password = trim($filter->filter($this->_request->getPost('log-pswd')));
$warnings = new Zend_Session_Namespace();
$warnings->username = $username;
$warnings->error = '';
$error_msg = '';
if ($username == '') {
$error_msg .= '<p>Enter your username.</p>';
} else {
if ($password == '') {
$error_msg .= '<p>Enter your password.</p>';
} else {
$data = new Users();
$query = 'login = "' . $username . '"';
$data_row = $data->fetchRow($query);
if (!count($data_row)) {
$error_msg .= '<p>There is no user with such username.</p>';
} else {
if ($data_row == '0') {
$error_msg .= '<p>Your account is not activated.</p>';
}
$check_pass = sha1($password . $data_row['salt']);
if ($check_pass != $data_row['password']) {
$error_msg .= '<p>Wrong password.</p>';
}
}
}
}
if ($error_msg != '') {
$warnings->error = $error_msg;
$warnings->status = '';
$this->_redirect('/');
return;
} else {
Zend_Loader::loadClass('Zend_Date');
$date = new Zend_Date();
$current_date = $date->toString('YYYY-MM-dd HH:mm:ss');
$where = 'login = "' . $username . '"';
$data = array('last_login' => $current_date);
$user_update = new Users();
$user_update->update($data, $where);
$warnings->error = '';
$warnings->username = '';
$warnings->email = '';
$warnings->real_name = '';
$warnings->status = ' hide';
$user_dates = new Zend_Session_Namespace();
$user_dates->username = $username;
$user_dates->status = '1';
$this->_redirect('/profile/');
return;
}
}
}
开发者ID:epoleacov,项目名称:Zend,代码行数:59,代码来源:IndexController.php
示例16: loginAction
public function loginAction()
{
// Don't allow logged in people here
$user = Zend_Auth::getInstance()->getIdentity();
if ($user !== null) {
$this->_redirect('/');
}
$this->view->title = 'Log in';
if ($this->_request->isPost()) {
// collect the data from the user
$f = new Zend_Filter_StripTags();
$username = $f->filter($this->_request->getPost('handle'));
$password = $f->filter($this->_request->getPost('password'));
if (empty($username) || empty($password)) {
$this->addErrorMessage('Please provide a username and password.');
} else {
// do the authentication
$authAdapter = $this->_getAuthAdapter($username, $password);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
$auth->getStorage()->write($authAdapter->getResult());
// Receive Zend_Session_Namespace object
$session = new Zend_Session_Namespace('Zend_Auth');
// Set the time of user logged in
$session->setExpirationSeconds(24*3600);
// If "remember" was marked
if ($this->getRequest()->getParam('rememberme') !== null) {
// remember the session for 604800s = 7 days
Zend_Session::rememberMe(604800);
}
$ns = new Zend_Session_Namespace('lastUrl');
$lastUrl = $ns->value;
if ($lastUrl !== '') {
$ns->value = '';
// If our last request was an tester ajax request just
// go back to /tester
$lastUrl = (strpos($lastUrl,'/tester/ajax') === false) ? $lastUrl : '/tester';
$this->_redirect($lastUrl);
}
$this->_redirect('/');
} else {
// failure: clear database row from session
$this->addErrorMessage('Login failed.');
}
}
} else {
$this->getResponse()->setHeader('HTTP/1.1', '403 Forbidden');
}
}
开发者ID:reith2004,项目名称:frapi,代码行数:59,代码来源:AuthController.php
示例17: stripTags
function stripTags($properties) {
$tag_filter = new Zend_Filter_StripTags();
foreach ($properties as $property) {
if ($this->has($property)) {
$this->$property = $tag_filter->filter($this->$property);
}
}
}
开发者ID:richjoslin,项目名称:rivety,代码行数:8,代码来源:Request.php
示例18: get
/**
* default method, strips tags
*
* @param string $key
*/
public static function get($key)
{
$filter = new Zend_Filter_StripTags();
$post = self::toObject();
if (isset($_POST[$key])) {
return trim($filter->filter($post->{$key}));
}
}
开发者ID:laiello,项目名称:digitalus-cms,代码行数:13,代码来源:Post.php
示例19: init
public function init()
{
$stripTags = new Zend_Filter_StripTags();
$stripTags->setTagsAllowed(array('p', 'a', 'img', 'strong', 'b', 'i', 'em', 's', 'del'));
$stripTags->setAttributesAllowed(array('href', 'target', 'rel', 'name', 'src', 'width', 'height', 'alt', 'title'));
$this->setAction('/rating/new');
$this->addElement('select', 'value', array('label' => 'Rating:', 'required' => true, 'multiOptions' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)))->addElement('textarea', 'comment', array('class' => 'richedit', 'label' => 'Comment:', 'filters' => array('StringTrim', $stripTags), 'validators' => array(new Zend_Validate_NotEmpty())))->addElement('hidden', 'recipe_id')->addElement('submit', 'submit');
}
开发者ID:vishaleyes,项目名称:cookingwithzend,代码行数:8,代码来源:Rating.php
示例20: testStripTagsUnicode
public function testStripTagsUnicode()
{
set_time_limit(30);
$value = '<div>This string will be<!-- Strange char r�d --> cleaned</div>';
$filter = new Zend_Filter_StripTags();
$valueFiltered = $filter->filter($value);
$this->assertEquals('This string will be cleaned', $valueFiltered);
}
开发者ID:Tony133,项目名称:zf-web,代码行数:8,代码来源:ZF-10119_StripTags.php
注:本文中的Zend_Filter_StripTags类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论