shell bypass 403
<?
class Slider extends AppModel {
public $archivos = array('imagen');
public $belongsTo = array(
'Inmueble' => array(
'className' => 'Inmueble',
'foreignKey' => 'inmueble_id'
)
);
public $validate = array(
'imagen' => array(
'required' => array(
'rule' => 'notEmptyFile',
'message' => 'Imagen requerida',
),
'ext' => array(
'allowEmpty' => true,
'rule' => array('checkExtension', array('jpg', 'jpeg', 'gif', 'png')),
'message' => 'La imagen introducida no es correcta (jpg, jpeg, gif, png)',
),
),
);
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();
}
}