function check_action_limit($action = null, $model = null, $record_id = null, $user_id = null, $ip = false) { $obj = new ActionLimit(); $item = array('action' => $action, 'model' => $model, 'record_id' => $record_id, 'user_id' => $user_id, 'action_ip' => $ip); if (empty($record_id)) { unset($item['record_id']); } $obj->checkOne($item); $return = array(); if (!$obj->state) { $return['state'] = $obj->state; $return['info'] = $obj->info; $return['url'] = $obj->url; } else { $return['state'] = true; } return $return; }
function check_action_limit($action = null, $model = null, $record_id = null, $user_id = null, $ip = false) { $obj = new ActionLimit(); $obj->checkOne(array('action' => $action, 'model' => $model, 'record_id' => $record_id, 'user_id' => $user_id, 'action_ip' => $ip)); if (!$obj->state) { $return['state'] = $obj->state; $return['info'] = $obj->info; $return['url'] = $obj->url; } return $return; }