Skip to content

Commit

Permalink
Dev: use LSYii_Validators for assesment rules
Browse files Browse the repository at this point in the history
Dev: Use LimeExpressionManager on assesments view .
Dev: TODO : add {TOTAL} and {PERC} on EM
  • Loading branch information
Shnoulle authored and c-schmitz committed Nov 23, 2012
1 parent 0353164 commit 4ccaab8
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions application/models/Assessment.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,10 @@ public static function model($class = __CLASS__)
public function rules()
{
return array(
array('name', 'xssfilter'),
array('message', 'xssfilter')
array('name,message','LSYii_Validators'),
);
}

/**
* Defines the customs validation rule xssfilter
*
* @param mixed $attribute
* @param mixed $params
*/
public function xssfilter($attribute,$params)
{
if(Yii::app()->getConfig('filterxsshtml') && Yii::app()->session['USER_RIGHT_SUPERADMIN'] != 1)
{
$filter = new CHtmlPurifier();
$filter->options = array('URI.AllowedSchemes'=>array(
'http' => true,
'https' => true,
));
$this->$attribute = $filter->purify($this->$attribute);
}
}

/**
* Returns the setting's table name to be used by the model
*
Expand Down

0 comments on commit 4ccaab8

Please sign in to comment.