Skip to content

Commit

Permalink
Merge branch '6.2.5' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jstanden committed Mar 1, 2013
2 parents 895f39c + 1c9290f commit 11dd475
Show file tree
Hide file tree
Showing 153 changed files with 25,464 additions and 20 deletions.
4 changes: 2 additions & 2 deletions api/Application.class.php
Expand Up @@ -46,8 +46,8 @@
* - Jeff Standen, Darren Sugita, Dan Hildebrandt, Scott Luther * - Jeff Standen, Darren Sugita, Dan Hildebrandt, Scott Luther
* WEBGROUP MEDIA LLC. - Developers of Cerberus Helpdesk * WEBGROUP MEDIA LLC. - Developers of Cerberus Helpdesk
*/ */
define("APP_BUILD", 2013021801); define("APP_BUILD", 2013022701);
define("APP_VERSION", '6.2.4'); define("APP_VERSION", '6.2.5');


define("APP_MAIL_PATH", APP_STORAGE_PATH . '/mail/'); define("APP_MAIL_PATH", APP_STORAGE_PATH . '/mail/');


Expand Down
2 changes: 1 addition & 1 deletion features/cerberusweb.core/api/login.classes.php
Expand Up @@ -80,7 +80,7 @@ function saveWorkerPrefs($worker) {


// If we're not an imposter, go to the login form // If we're not an imposter, go to the login form
if(!$visit->isImposter()) { if(!$visit->isImposter()) {
$session->clearAll(); $session->clear();
$query = array( $query = array(
'email' => $worker->email, 'email' => $worker->email,
); );
Expand Down
19 changes: 15 additions & 4 deletions features/cerberusweb.core/api/uri/files.php
Expand Up @@ -31,8 +31,8 @@ function handleRequest(DevblocksHttpRequest $request) {


$stack = $request->path; // URLS like: /files/10000/plaintext.txt $stack = $request->path; // URLS like: /files/10000/plaintext.txt
array_shift($stack); // files array_shift($stack); // files
$file_guid = array_shift($stack); // GUID $file_guid = array_shift($stack); // GUID
$file_name = array_shift($stack); // plaintext.txt $file_name = array_shift($stack); // plaintext.txt


// Security // Security
if(null == ($active_worker = CerberusApplication::getActiveWorker())) if(null == ($active_worker = CerberusApplication::getActiveWorker()))
Expand Down Expand Up @@ -70,9 +70,20 @@ function handleRequest(DevblocksHttpRequest $request) {
// header("Keep-Alive: timeout=5, max=100"); // header("Keep-Alive: timeout=5, max=100");
// header("Connection: Keep-Alive"); // header("Connection: Keep-Alive");
header("Content-Type: " . $file->mime_type); header("Content-Type: " . $file->mime_type);
header("Content-Length: " . $file_stats['size']);


fpassthru($fp); switch(strtolower($file->mime_type)) {
case 'text/html':
$clean_html = DevblocksPlatform::purifyHTML($fp);
header("Content-Length: " . strlen($clean_html));
echo $clean_html;
break;

default:
header("Content-Length: " . $file_stats['size']);
fpassthru($fp);
break;
}

fclose($fp); fclose($fp);


exit; exit;
Expand Down
4 changes: 2 additions & 2 deletions features/cerberusweb.core/api/uri/login.php
Expand Up @@ -161,7 +161,7 @@ function render() {
unset($_COOKIE['cerb_login_email']); unset($_COOKIE['cerb_login_email']);


$url_writer = DevblocksPlatform::getUrlService(); $url_writer = DevblocksPlatform::getUrlService();
setcookie('cerb_login_email', null, time()-3600, $url_writer->write('c=login',false,false)); setcookie('cerb_login_email', null, time()-3600, $url_writer->write('c=login',false,false), null, null, true);


DevblocksPlatform::redirect(new DevblocksHttpRequest(array('login'))); DevblocksPlatform::redirect(new DevblocksHttpRequest(array('login')));
break; break;
Expand Down Expand Up @@ -262,7 +262,7 @@ function routerAction() {


if($remember_me) { if($remember_me) {
$url_writer = DevblocksPlatform::getUrlService(); $url_writer = DevblocksPlatform::getUrlService();
setcookie('cerb_login_email', $email, time()+30*86400, $url_writer->write('c=login',false,false)); setcookie('cerb_login_email', $email, time()+30*86400, $url_writer->write('c=login',false,false), null, null, true);
} }


$query = array( $query = array(
Expand Down
5 changes: 4 additions & 1 deletion features/cerberusweb.core/api/uri/portal.php
Expand Up @@ -115,7 +115,10 @@ public static function getFingerprint() {
'GroupLoginPassport', 'GroupLoginPassport',
serialize(self::$_fingerprint), serialize(self::$_fingerprint),
0, 0,
'/' '/',
null,
null,
true
); );
} }
} }
Expand Down
Expand Up @@ -25,10 +25,13 @@
$this.dialog('option','title',"{'mail.merge'|devblocks_translate|capitalize}"); $this.dialog('option','title',"{'mail.merge'|devblocks_translate|capitalize}");
$this.find('button.submit').click(function() { $this.find('button.submit')
ajax.viewTicketsAction('{$view_id}','merge'); .click(function() {
genericAjaxPopupClose('merge'); ajax.viewTicketsAction('{$view_id}','merge');
}); genericAjaxPopupClose('merge');
})
.focus()
;
$this.find('button.cancel').click(function() { $this.find('button.cancel').click(function() {
genericAjaxPopupClose('merge'); genericAjaxPopupClose('merge');
Expand Down
2 changes: 1 addition & 1 deletion features/wgm.login.password.google_auth/api/App.php
Expand Up @@ -77,7 +77,7 @@ function saveWorkerPrefs($worker) {


// If we're not an imposter, go to the login form // If we're not an imposter, go to the login form
if(!$visit->isImposter()) { if(!$visit->isImposter()) {
$session->clearAll(); $session->clear();
$query = array( $query = array(
'email' => $worker->email, 'email' => $worker->email,
//'url' => '', // [TODO] This prefs URL //'url' => '', // [TODO] This prefs URL
Expand Down
Expand Up @@ -80,7 +80,14 @@
</form> </form>


<script type="text/javascript"> <script type="text/javascript">
$('#qrcode').qrcode({ width:192, height:192, text:"otpauth://totp/Cerb:{$worker->email}?secret={$seed}" }); var options = { width:192, height:192, text:"otpauth://totp/Cerb:{$worker->email}?secret={$seed}" };
var hasCanvasSupport = !!window.CanvasRenderingContext2D;
// If no <canvas> tag, use <table> instead
if(!hasCanvasSupport)
options.render = 'table';
$('#qrcode').qrcode(options);
$('#loginForm').find('input:text').first().focus(); $('#loginForm').find('input:text').first().focus();
</script> </script>
28 changes: 28 additions & 0 deletions libs/devblocks/Devblocks.class.php
Expand Up @@ -493,6 +493,34 @@ function($matches) {
return $str; return $str;
} }


static function purifyHTML($dirty_html) {
// Register HTMLPurifier
require_once(DEVBLOCKS_PATH . 'libs/htmlpurifier/HTMLPurifier.standalone.php');

// If we're passed a file pointer, load the literal string
if(is_resource($dirty_html)) {
$fp = $dirty_html;
$dirty_html = null;
while(!feof($fp))
$dirty_html .= fread($fp, 4096);
}

$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Doctype', 'HTML 4.01 Transitional');

$dir_htmlpurifier_cache = APP_TEMP_PATH . '/cache/htmlpurifier/';

if(!is_dir($dir_htmlpurifier_cache)) {
mkdir($dir_htmlpurifier_cache, 0755);
}

$config->set('Cache.SerializerPath', $dir_htmlpurifier_cache);

$purifier = new HTMLPurifier($config);

return $purifier->purify($dirty_html);
}

static function parseMarkdown($text) { static function parseMarkdown($text) {
static $parser = null; static $parser = null;


Expand Down
8 changes: 4 additions & 4 deletions libs/devblocks/api/services/event/event_helper.php
Expand Up @@ -307,7 +307,7 @@ static function simulateActionSetCustomField(Model_CustomField $custom_field, $v
$dict->$value_key.'_'.$field_id = implode(',',$opts); $dict->$value_key.'_'.$field_id = implode(',',$opts);


$array =& $dict->$value_key; $array =& $dict->$value_key;
$array[$field_id] = $value; $array[$field_id] = $opts;
} }


break; break;
Expand Down Expand Up @@ -335,7 +335,7 @@ static function simulateActionSetCustomField(Model_CustomField $custom_field, $v
$dict->$value_key.'_'.$field_id = $worker_id; $dict->$value_key.'_'.$field_id = $worker_id;


$array =& $dict->$value_key; $array =& $dict->$value_key;
$array[$field_id] = $value; $array[$field_id] = $worker_id;
} }
break; break;


Expand Down Expand Up @@ -400,7 +400,7 @@ static function runActionSetCustomField(Model_CustomField $custom_field, $value_
$dict->$value_key.'_'.$field_id = implode(',',$opts); $dict->$value_key.'_'.$field_id = implode(',',$opts);


$array =& $dict->$value_key; $array =& $dict->$value_key;
$array[$field_id] = $value; $array[$field_id] = $opts;
} }


break; break;
Expand All @@ -419,7 +419,7 @@ static function runActionSetCustomField(Model_CustomField $custom_field, $value_
$dict->$value_key.'_'.$field_id = $worker_id; $dict->$value_key.'_'.$field_id = $worker_id;


$array =& $dict->$value_key; $array =& $dict->$value_key;
$array[$field_id] = $value; $array[$field_id] = $worker_id;
} }
break; break;


Expand Down

0 comments on commit 11dd475

Please sign in to comment.