shell bypass 403
<?
App::uses('Area', 'Model');
class Localidad extends AppModel {
public $validate = array(
'area_id' => array(
'exist' => array(
'allowEmpty' => true,
'rule' => 'checkExist',
'message' => 'Debes seleccionar un cliente existente'
)
),
);
public function checkExist($check) {
$elemento = null;
$campo = key($check);
switch ($campo) {
case 'area_id':
$elementos = new Area();
$elemento = $elementos->findById($this->data[$this->name][$campo]);
break;
}
if (empty($elemento)) {
return false; //error
}
return true; //ok
}
}