shell bypass 403
<?
class InmuebleListadoFiltro extends AppModel {
public $useTable = 'inmuebles_listados_filtros';
public $belongsTo = array(
'InmuebleTipo' => array(
'className' => 'InmuebleTipo',
'foreignKey' => 'valor',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
public $validate = array(
'nombre' => array(
'required' => array(
'rule' => 'notBlank',
'message' => 'Nombre requerido'
)
),
);
public function afterSave($created, $options = array()) {
parent::afterSave($created, $options);
//Orden
if ($created) {
$ultima = $this->find('first', array('order' => array($this->name . '.orden' => 'DESC')));
if (!empty($ultima)) {
$orden = (int) $ultima[$this->name]['orden'] + 1;
} else {
$orden = 1;
}
$this->updateAll(array('orden' => $orden), array($this->name . '.id' => $this->id));
}
}
public function afterDelete() {
parent::afterDelete();
$this->reordenarEntidades();
}
}