Skip to content
Snippets Groups Projects
Commit 55eae1cf authored by Jared Hancock's avatar Jared Hancock
Browse files

lint: Fix several issues from regression tests

parent 2db06d35
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,7 @@ require('client.inc.php');
if(!defined('INCLUDE_DIR')) Http::response(500, 'Server configuration error');
require_once INCLUDE_DIR.'/class.dispatcher.php';
$dispatcher = patterns('',
);
$dispatcher = new Dispatcher();
Signal::send('ajax.client', $dispatcher);
print $dispatcher->resolve($ost->get_path_info());
......@@ -157,6 +157,7 @@ class ContentAjaxAPI extends AjaxController {
Http::response(404, 'No such content');
$vars = array_merge($content->getHashtable(), $_POST);
$errors = array();
if (!$content->save($id, $vars, $errors)) {
if ($errors['err'])
Http::response(422, $errors['err']);
......
......@@ -309,6 +309,7 @@ class UsersAjaxAPI extends AjaxController {
|| !($account=$user->getAccount()))
Http::response(404, 'Unknown user account');
$info = array();
$info['title'] = 'Organization for '.$user->getName();
$info['action'] = '#users/'.$user->getId().'/org';
$info['onselect'] = 'ajax.php/users/'.$user->getId().'/org';
......
......@@ -13,6 +13,8 @@
vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
require_once INCLUDE_DIR.'class.user.php';
abstract class TicketUser {
static private $token_regex = '/^(?P<type>\w{1})(?P<algo>\d+)x(?P<hash>.*)$/i';
......@@ -307,6 +309,8 @@ class ClientAccount extends UserAccount {
}
function update($vars, &$errors) {
global $cfg;
$rtoken = $_SESSION['_client']['reset-token'];
if ($vars['passwd1'] || $vars['passwd2'] || $vars['cpasswd'] || $rtoken) {
......
......@@ -828,7 +828,7 @@ class MySqlCompiler extends SqlCompiler {
return (string)$q;
}
elseif ($what instanceof SqlFunction) {
return $val->toSql($this);
return $what->toSql($this);
}
else {
$this->params[] = $what;
......
......@@ -789,7 +789,7 @@ class Staff extends AuthenticatedUser {
$_config = new Config('pwreset');
$_config->set($vars['token'], $this->getId());
$email->send($this->getEmail(), Format::stripTags($msg['subj']),
$email->send($this->getEmail(), Format::striptags($msg['subj']),
$msg['body']);
}
......
......@@ -2157,7 +2157,7 @@ class Ticket {
};
};
$reject_ticket = function($message) use (&$errors) {
$reject_ticket = function($message) use (&$errors, $ost) {
$errors = array(
'errno' => 403,
'err' => 'This help desk is for use by authorized users only');
......
......@@ -32,8 +32,7 @@ ini_set('display_startup_errors','0');
if(!defined('INCLUDE_DIR')) Http::response(500, 'Server configuration error');
require_once INCLUDE_DIR.'/class.dispatcher.php';
$dispatcher = patterns('',
);
$dispatcher = new Dispatcher();
Signal::send('apps.scp', $dispatcher);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment