本文整理汇总了PHP中valid_id函数的典型用法代码示例。如果您正苦于以下问题:PHP valid_id函数的具体用法?PHP valid_id怎么用?PHP valid_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了valid_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: LookupKingdomAward
public function LookupKingdomAward($request)
{
if (valid_id($request['KingdomAwardId'])) {
$kingdomaward = new yapo($this->db, DB_PREFIX . 'kingdomaward');
$kingdomaward->clear();
$kingdomaward->kingdomaward_id = $request['KingdomAwardId'];
$kingdomaward->find();
return array($kingdomaward->award_id, $kingdomaward->kingdom_id);
}
}
示例2: GetParkLocations
public function GetParkLocations($request)
{
$this->park->clear();
$this->park->active = 'Active';
$locations = array();
if (valid_id($request['KingdomId'])) {
$this->park->kingdom_id = $request['KingdomId'];
}
$kingdoms = Ork3::$Lib->kingdom->GetKingdoms(array());
if ($this->park->find()) {
do {
$locations[] = array('Location' => $this->park->location, 'ParkId' => $this->park->park_id, 'Directions' => $this->park->directions, 'Description' => $this->park->description, 'HasHeraldry' => $this->park->has_heraldry, 'Name' => $this->park->name, 'KingdomId' => $this->park->kingdom_id, 'KingdomName' => $kingdoms['Kingdoms'][$this->park->kingdom_id]['KingdomName'], 'KingdomColor' => $kingdoms['Kingdoms'][$this->park->kingdom_id]['KingdomColor']);
} while ($this->park->next());
}
return array('Parks' => $locations);
}
示例3: fetch_award_option_list
function fetch_award_option_list($kingdom_id = 0)
{
if (valid_id($kingdom_id)) {
$awards = $this->Kingdom->GetAwardList(['IsLadder' => null, 'IsTitle' => null, 'KingdomId' => $kingdom_id]);
} else {
$awards = $this->Award->GetAwardList(['IsLadder' => null, 'IsTitle' => null]);
}
if ($awards['Status']['Status'] == 0) {
foreach ($awards['Awards'] as $k => $award) {
$options .= "<option value='{$award['KingdomAwardId']}'>{$award['KingdomAwardName']}</option>\n";
}
return $options;
} else {
return false;
}
}
示例4: __construct
public function __construct($call = null, $id = null)
{
parent::__construct($call, $id);
$this->load_model('Park');
$this->load_model('Kingdom');
$params = explode('/', $id);
$event_id = $params[0];
$this->data['EventDetails'] = $this->Event->get_event_details($event_id);
if ($this->data['EventDetails']['Status']['Status'] != 0) {
$this->data['Error'] = $this->data['EventDetails']['Status']['Error'];
}
if (valid_id($this->data['EventDetails']['KingdomId'])) {
$this->data['menu']['kingdom'] = ['url' => UIR . 'Kingdom/index/' . $this->data['EventDetails']['KingdomId'], 'display' => $this->data['EventDetails']['EventInfo'][0]['KingdomName']];
}
if (valid_id($this->data['EventDetails']['ParkId'])) {
$this->data['menu']['park'] = ['url' => UIR . 'Park/index/' . $this->data['EventDetails']['ParkId'], 'display' => $this->data['EventDetails']['EventInfo'][0]['ParkName']];
}
$this->data['menu']['event'] = ['url' => UIR . 'Event/index/' . $id, 'display' => $this->data['EventDetails']['Name']];
$this->data['menu']['admin'] = ['url' => UIR . 'Admin/event/' . $id, 'display' => 'Admin'];
$this->data['menulist']['admin'] = [['url' => UIR . 'Admin/event/' . $id, 'display' => 'Event']];
}
示例5: RemoveAward
public function RemoveAward($request)
{
logtrace("RemoveAward()", $request);
$mundane_id = Ork3::$Lib->authorization->IsAuthorized($request['Token']);
$awards = new yapo($this->db, DB_PREFIX . 'awards');
$awards->clear();
$awards->awards_id = $request['AwardsId'];
if (valid_id($request['AwardsId']) && $awards->find()) {
$mundane = $this->player_info($awards->mundane_id);
if (valid_id($mundane_id) && Ork3::$Lib->authorization->HasAuthority($mundane_id, AUTH_PARK, $mundane['ParkId'], AUTH_EDIT)) {
$awards->delete();
} else {
return NoAuthorization();
}
} else {
return InvalidParameter();
}
}
示例6: CacheMap
function CacheMap($ork_t, $ork_id, $reverse = false, $ork_t_opp = null)
{
if (!valid_id($ork_id)) {
die("<h3>Must select a valid ork id!: CacheMap({$ork_t}, {$ork_id}, {$reverse} = false, {$ork_t_opp} = null)</h3>");
}
$this->cache->clear();
if ($reverse) {
$table = 'ork3_table';
$id = 'ork3_id';
$rtable = 'ork2_table';
$rid = 'ork2_id';
} else {
$table = 'ork2_table';
$id = 'ork2_id';
$rtable = 'ork3_table';
$rid = 'ork3_id';
}
$this->cache->{$table} = $ork_t;
$this->cache->{$id} = $ork_id;
if (!is_null($ork_t_opp)) {
$this->cache->{$rtable} = $ork_t_opp;
}
if ($this->cache->find()) {
return array($this->cache->{$rtable}, $this->cache->{$rid});
}
}
示例7: kingdom
public function kingdom($id)
{
$params = explode('/', $id);
$id = $params[0];
if (count($params) > 1) {
$action = $params[1];
}
if (strlen($action) > 0) {
$this->request->save('Award_addawards', true);
$r = array('Status' => 0);
if (!isset($this->session->user_id)) {
header('Location: ' . UIR . "Login/login/Award/kingdom/{$id}");
} else {
switch ($action) {
case 'addaward':
if (!valid_id($this->request->Award_addawards->MundaneId)) {
$this->data['Error'] = 'You must choose a recipient. Award not added!';
break;
}
if (!valid_id($this->request->Award_addawards->AwardId)) {
$this->data['Error'] = 'You must choose an award. Award not added!';
break;
}
if (!valid_id($this->request->Award_addawards->GivenById)) {
$this->data['Error'] = 'Who gave this award? Award not added!';
break;
}
$r = $this->Player->add_player_award(array('Token' => $this->session->token, 'RecipientId' => $this->request->Award_addawards->MundaneId, 'KingdomAwardId' => $this->request->Award_addawards->AwardId, 'Rank' => $this->request->Award_addawards->Rank, 'Date' => $this->request->Award_addawards->Date, 'GivenById' => $this->request->Award_addawards->GivenById, 'Note' => $this->request->Award_addawards->Note, 'ParkId' => valid_id($this->request->Award_addawards->ParkId) ? $this->request->Award_addawards->ParkId : 0, 'KingdomId' => valid_id($this->request->Award_addawards->KingdomId) ? $this->request->Award_addawards->KingdomId : 0, 'EventId' => valid_id($this->request->Award_addawards->EventId) ? $this->request->Award_addawards->EventId : 0));
break;
}
if ($r['Status'] == 0) {
$this->data['Message'] = 'Award recorded for ' . $this->request->Award_addawards->GivenTo;
$this->request->clear('Player_index');
unset($_REQUEST['MundaneId']);
unset($_REQUEST['AwardId']);
unset($_REQUEST['Rank']);
unset($_REQUEST['Note']);
unset($_REQUEST['GivenTo']);
$this->request->save('Award_addawards', true);
} else {
if ($r['Status'] == 5) {
header('Location: ' . UIR . "Login/login/Award/kingdom/{$id}");
} else {
$this->data['Error'] = $r['Error'] . ':<p>' . $r['Detail'];
}
}
}
}
$this->template = 'Award_addawards.tpl';
if ($this->request->exists('Award_addawards')) {
$this->data['Award_addawards'] = $this->request->Award_addawards->Request;
}
$this->data['AwardOptions'] = $this->Award->fetch_award_option_list($this->session->kingdom_id);
$this->data['Id'] = $id;
}
示例8: RemoveAttendance
public function RemoveAttendance($request)
{
logtrace("Attendance->RemoveAttendance()", $request);
if ($this->AttendanceAuthority($request) === false) {
return NoAuthorization();
}
$this->attendance->clear();
$this->attendance->attendance_id = $request['AttendanceId'];
if (!valid_id($request['AttendanceId']) || !$this->attendance->find()) {
return InvalidParameter();
}
$this->attendance->delete();
return Success($this->attendance->attendance_id);
}
示例9: GetActivePlayers
public function GetActivePlayers($request)
{
if (strlen($request['MinimumWeeklyAttendance']) == 0) {
$request['MinimumWeeklyAttendance'] = 0;
}
if (strlen($request['MinimumDailyAttendance']) == 0) {
$request['MinimumDailyAttendance'] = 6;
}
if (strlen($request['MonthlyCreditMaximum']) == 0) {
$request['MonthlyCreditMaximum'] = 6;
}
if (strlen($request['MinimumCredits']) == 0) {
$request['MinimumCredits'] = 9;
}
if (strlen($request['PerWeeks']) == 0 && strlen($request['PerMonths']) == 0) {
$request['PerMonths'] = 6;
}
if (strlen($request['ReportFromDate']) == 0) {
$request['ReportFromDate'] = 'curdate()';
}
if (strlen($request['PerWeeks']) > 0) {
$per_period = mysql_real_escape_string($request['PerWeeks']) . ' week';
} else {
$per_period = mysql_real_escape_string($request['PerMonths']) . ' month';
}
if (valid_id($request['ParkId'])) {
$location = " and m.park_id = '" . mysql_real_escape_string($request['ParkId']) . "'";
$duesclause = "a.park_id = '" . mysql_real_escape_string($request['ParkId']) . "'";
if (valid_id($request['ByLocalPark'])) {
$park_comparator = " and a.park_id = '" . mysql_real_escape_string($request['ParkId']) . "' ";
}
} else {
if (strlen($request['KingdomId']) > 0 && $request['KingdomId'] > 0) {
$location = " and m.kingdom_id = '" . mysql_real_escape_string($request['KingdomId']) . "'";
$duesclause = "a.kingdom_id = '" . mysql_real_escape_string($request['KingdomId']) . "'";
if (valid_id($request['ByKingdom'])) {
$park_list = Ork3::$Lib->Kingdom->GetParks($request);
$parks = array();
foreach ($park_list['Parks'] as $p => $park) {
$parks[] = $p['ParkId'];
}
$park_comparator = " and a.park_id in (" . implode($parks) . ") ";
}
} else {
$park_comparator = "";
}
}
if ($request['KingdomId'] > 0 || $request['ParkId'] > 0) {
if ($request['DuesPaid']) {
$has_dues = "and s.is_dues = 1";
}
$duespaid_clause = "\n\t\t\t\t\tleft join \n\t\t\t\t\t\t(select distinct case split_id when null then 0 else 1 end as split_id, src_mundane_id \n\t\t\t\t\t\t\tfrom " . DB_PREFIX . "split s \n\t\t\t\t\t\t\tleft join " . DB_PREFIX . "account a on s.account_id = a.account_id \n\t\t\t\t\t\t\t\tand {$duesclause}\n\t\t\t\t\t\t\t\t{$has_dues}\n\t\t\t\t\t\t\twhere s.dues_through > curdate()) dues on attendance_summary.mundane_id = dues.src_mundane_id\n\t\t\t";
$duespaid_field = ',
ifnull(split_id,0) as duespaid';
$duespaid_order = 'duespaid desc, ';
}
if (trimlen($request['Peerage']) > 0) {
$peerage = "\n left join\n (select distinct awards.mundane_id, award.peerage \n from " . DB_PREFIX . "awards awards\n left join " . DB_PREFIX . "kingdomaward ka on ka.kingdomaward_id = awards.kingdomaward_id\n left join " . DB_PREFIX . "award award on ka.award_id = award.award_id\n left join " . DB_PREFIX . "mundane m on awards.mundane_id = m.mundane_id\n where award.peerage = '" . mysql_real_escape_string($request['Peerage']) . "' and awards.mundane_id > 0 {$location}\n group by awards.mundane_id\n ) peers on attendance_summary.mundane_id = peers.mundane_id\n ";
$peerage_clause = "and peers.peerage = '" . mysql_real_escape_string($request['Peerage']) . "'";
$peer_field = 'peers.peerage, ';
}
if ($request['Waivered']) {
$waiver_clause = ' and m.waivered = 1';
} else {
if ($request['UnWaivered']) {
$waiver_clause = ' and m.waivered = 0';
}
}
$sql = "\n select main_summary.*, total_monthly_credits, credit_counts.daily_credits, credit_counts.rop_limited_credits\n from\n (select \n \t\t\t\t\t\t{$peer_field} count(week) as weeks_attended, sum(weekly_attendance) as park_days_attended, sum(daily_attendance) as days_attended, sum(credits_earned) total_credits, attendance_summary.mundane_id, \n \t\t\t\t\t\t\tmundane.persona, kingdom.kingdom_id, park.park_id, kingdom.name kingdom_name, kingdom.parent_kingdom_id, park.name park_name, attendance_summary.waivered {$duespaid_field}\n \t\t\t\t\tfrom\n \t\t\t\t\t\t(select \n \t\t\t\t\t\t\t\ta.park_id > 0 as weekly_attendance, count(a.park_id > 0) as daily_attendance, a.mundane_id, \n week(a.date,3) as week, year(a.date) as year, a.kingdom_id, a.park_id, max(credits) as credits_earned, m.waivered \n \t\t\t\t\t\t\tfrom " . DB_PREFIX . "attendance a\n \t\t\t\t\t\t\t\tleft join " . DB_PREFIX . "mundane m on a.mundane_id = m.mundane_id\n \t\t\t\t\t\t\twhere \n date > adddate(curdate(), interval -{$per_period}) {$park_comparator} {$location} {$waiver_clause}\n \t\t\t\t\t\t\tgroup by week(date,3), year(date), mundane_id) attendance_summary \n \t\t\t\t\tleft join " . DB_PREFIX . "mundane mundane on mundane.mundane_id = attendance_summary.mundane_id\n \t\t\t\t\t\tleft join " . DB_PREFIX . "kingdom kingdom on kingdom.kingdom_id = mundane.kingdom_id\n \t\t\t\t\t\tleft join " . DB_PREFIX . "park park on park.park_id = mundane.park_id\n \t\t\t\t\t{$duespaid_clause}\n {$peerage}\n \t\t\t\t\tgroup by mundane_id\n \t\t\t\t\thaving\n \t\t\t\t\t\tweeks_attended >= '" . mysql_real_escape_string($request['MinimumWeeklyAttendance']) . "'\n and days_attended >= '" . mysql_real_escape_string($request['MinimumDailyAttendance']) . "'\n and total_credits >= '" . mysql_real_escape_string($request['MinimumCredits']) . "'\n {$peerage_clause}\n \t\t\t\t\torder by {$duespaid_order} kingdom_name, park_name, persona) main_summary\n left join\n (select mundane_id, sum(monthly_credits) as total_monthly_credits\n from\n (select \n \t\t\t\t\t\t\tleast(sum(credits), " . mysql_real_escape_string($request['MonthlyCreditMaximum']) . ") as monthly_credits, a.mundane_id\n \t\t\t\t\t\t\tfrom ork_attendance a\n \t\t\t\t\t\t\t\tleft join ork_mundane m on a.mundane_id = m.mundane_id\n \t\t\t\t\t\t\twhere \n date > adddate(curdate(), interval -{$per_period}) {$location} {$waiver_clause}\n \t\t\t\t\t\t\tgroup by month(date), year(date), mundane_id) monthly_list\n group by monthly_list.mundane_id) monthly_summary on main_summary.mundane_id = monthly_summary.mundane_id\n left join\n (select mundane_id, sum(daily_credits) as daily_credits, sum(rop_limited_credits) as rop_limited_credits\n from \n (select least(" . mysql_real_escape_string($request['MonthlyCreditMaximum']) . ", sum(daily_credits)) as daily_credits, least(" . mysql_real_escape_string($request['MonthlyCreditMaximum']) . ", sum(rop_credits)) rop_limited_credits, mundane_id\n from\n (select \n \t\t\t\t\t\t\tmax(credits) as daily_credits, 1 as rop_credits, a.mundane_id, a.date\n \t\t\t\t\t\t\tfrom ork_attendance a\n \t\t\t\t\t\t\t\tleft join ork_mundane m on a.mundane_id = m.mundane_id\n \t\t\t\t\t\t\twhere \n date > adddate(curdate(), interval -{$per_period}) {$location} {$waiver_clause}\n \t\t\t\t\t\t\tgroup by dayofyear(date), year(date), mundane_id) credit_list_source\n \t\t\t\t\t group by mundane_id, month(`date`)) credit_list\n group by credit_list.mundane_id) credit_counts on main_summary.mundane_id = credit_counts.mundane_id\n\t\t\t\t\t";
// For last join, need to limit monthly credits to monthly credit maximum per kingdom config
logtrace('Report: GetActivePlayers', array($request, $sql));
$r = $this->db->query($sql);
$report = array();
if ($r !== false && $r->size() > 0) {
do {
$report[] = array('KingdomName' => $r->kingdom_name, 'KingdomId' => $r->kingdom_id, 'ParentKingdomId' => $r->parent_kingodm_id, 'ParkName' => $r->park_name, 'ParkId' => $r->park_id, 'Persona' => $r->persona, 'MundaneId' => $r->mundane_id, 'TotalCredits' => $r->total_credits, 'TotalMonthlyCredits' => $r->total_monthly_credits, 'WeeksAttended' => $r->weeks_attended, 'ParkDaysAttended' => $r->park_days_attended, 'DaysAttended' => $r->days_attended, 'DailyCredits' => $r->daily_credits, 'RopLimitedCredits' => $r->rop_limited_credits, 'DuesPaid' => $r->duespaid, 'Waivered' => $r->waivered);
} while ($r->next());
}
$response = array('Status' => Success(), 'ActivePlayerSummary' => $report);
return $response;
}
示例10: HasAuthority
public function HasAuthority($mundane_id, $type, $id, $role)
{
logtrace("HasAuthority", [$mundane_id, $type, $id, $role]);
if (valid_id($mundane_id) && (valid_id($id) || $type == AUTH_ADMIN)) {
} else {
if ($type == AUTH_ADMIN && valid_id($mundane_id)) {
} else {
return false;
}
}
// Is Admin?
$this->auth->clear();
$this->auth->mundane_id = $mundane_id;
$this->auth->role = AUTH_ADMIN;
if ($this->auth->find() && $this->auth->size() > 0) {
return true;
}
// Playing shenanigans
if (0 == $id) {
return false;
}
// Check for bans
$this->mundane->clear();
$this->mundane->mundane_id = $mundane_id;
if (!$this->mundane->find()) {
return false;
} else {
if ($this->mundane->penalty_box == 1) {
return false;
}
}
$this->auth->clear();
$this->auth->mundane_id = $mundane_id;
// Basic check -- does the user have direct access?
// NOTE: Admin check here does not check for admin privileges per se, but for whether
// an Admin Authorization request is avail (Admin == Admin)
// For elevated privileges (Admin > Park|Kingdom|Event|Unit), the check is handled below
switch ($type) {
case AUTH_PARK:
$this->auth->park_id = $id;
break;
case AUTH_KINGDOM:
$this->auth->kingdom_id = $id;
break;
case AUTH_EVENT:
$this->auth->event_id = $id;
break;
case AUTH_UNIT:
$this->auth->unit_id = $id;
break;
case AUTH_ADMIN:
$this->auth->role = AUTH_ADMIN;
break;
default:
return false;
}
if ($this->auth->find() && $id != 0) {
$sufficient = false;
do {
switch ($this->auth->role) {
case AUTH_EDIT:
$sufficient |= AUTH_EDIT == $role;
case AUTH_CREATE:
return true;
case AUTH_ADMIN:
return true;
}
} while ($this->auth->next());
// Something matched, fly away my pretty!
if ($sufficient) {
return true;
}
}
if ($type == AUTH_ADMIN) {
return false;
}
// Upper-level authority check, we have to find the parents of
// of the subject, and check their auths
// !$sufficient is redundant, but I don't trust the next guy to hold the invariant
if (!$sufficient && $type != AUTH_KINGDOM) {
switch ($type) {
case AUTH_PARK:
$park = new yapo($this->db, DB_PREFIX . 'park');
$park->clear();
$park->park_id = $id;
if ($park->find()) {
$id = $park->kingdom_id;
if ($this->HasAuthority($mundane_id, AUTH_KINGDOM, $id, $role)) {
return true;
}
}
break;
case AUTH_EVENT:
$event = new yapo($this->db, DB_PREFIX . 'event');
$event->clear();
$event->event_id = $id;
if ($event->find()) {
if ($this->HasAuthority($mundane_id, AUTH_KINGDOM, $event->kingdom_id, $role) || $this->HasAuthority($mundane_id, AUTH_PARK, $event->park_id, $role) || ($event->mundane_id = $mundane_id)) {
return true;
}
//.........这里部分代码省略.........
示例11: SetKingdomParkTitles
public function SetKingdomParkTitles($request)
{
$response = [];
if (($mundane_id = Ork3::$Lib->authorization->IsAuthorized($request['Token'])) > 0 && Ork3::$Lib->authorization->HasAuthority($mundane_id, AUTH_KINGDOM, $request['KingdomId'], AUTH_EDIT)) {
$this->log->Write('Kingdom', $mundane_id, LOG_EDIT, $request);
if (is_array($request['ParkTitles'])) {
$parktitle = new yapo($this->db, DB_PREFIX . 'parktitle');
foreach ($request['ParkTitles'] as $k => $title) {
switch ($title['Action']) {
case CFG_REMOVE:
$parktitle->clear();
$parktitle->parktitle_id = $title['ParkTitleId'];
if (valid_id($title['ParkTitleId']) && $parktitle->find()) {
if ($parktitle->kingdom_id != $request['KingdomId']) {
$response['Status'] = NoAuthorization('You cannot edit the park titles of another kingdom.');
return $response;
}
$parktitle->delete();
}
break;
case CFG_EDIT:
$parktitle->clear();
$parktitle->parktitle_id = $title['ParkTitleId'];
if (valid_id($title['ParkTitleId']) && $parktitle->find()) {
if ($parktitle->kingdom_id != $request['KingdomId']) {
$response['Status'] = NoAuthorization('You cannot edit the park titles of another kingdom.');
return $response;
}
$parktitle->title = strlen($title['Title']) ? $title['Title'] : $parktitle->title;
$parktitle->class = strlen($title['Class']) ? $title['Class'] : $parktitle->class;
$parktitle->minimumattendance = strlen($title['MinimumAttendance']) ? $title['MinimumAttendance'] : $parktitle->minimumattendance;
$parktitle->minimumcutoff = strlen($title['MinimumCutoff']) ? $title['MinimumCutoff'] : $parktitle->minimumcutoff;
$parktitle->period = strlen($title['Period']) ? $title['Period'] : $parktitle->period;
$parktitle->period_length = strlen($title['PeriodLength']) ? $title['PeriodLength'] : $parktitle->period_length;
$parktitle->save();
}
break;
case CFG_ADD:
$parktitle->clear();
$parktitle->kingdom_id = $request['KingdomId'];
$parktitle->title = $title['Title'];
$parktitle->class = $title['Class'];
$parktitle->minimumattendance = $title['MinimumAttendance'];
$parktitle->minimumcutoff = $title['MinimumCutoff'];
$parktitle->period = $title['Period'];
$parktitle->period_length = $title['PeriodLength'];
$parktitle->save();
break;
}
}
}
$response = Success();
} else {
$response = NoAuthorization(null, $mundane_id);
}
return $response;
}
示例12: sendmessage_closed
function sendmessage_closed($call_id)
{
$call_id = valid_id($call_id);
$db = new ezSQL_mysqli(db_user, db_password, db_name, db_host);
$mail = new PHPMailer();
//Set who the message is to be sent from
$mail->SetFrom(FROM_EMAIL);
//Set who the message is to be sent to
$call_email = $db->get_var("SELECT call_email FROM site_calls WHERE call_id = {$call_id};");
$mail->AddAddress($call_email);
//Set the subject line
$mail->Subject = 'Ticket ' . FHD_TITLE . ' [# ' . $call_id . '] Closed.';
//Read an HTML message body from an external file, convert referenced images to embedded, convert HTML into a basic plain-text alternative body
$call_solution = $db->get_var("SELECT call_solution FROM site_calls WHERE call_id = {$call_id};");
$econtent = "Ticket Closed.<br><hr>" . $call_solution;
$mail->MsgHTML($econtent . "<br>");
//Send the message
$mail->Send();
}
示例13: SetEvent
public function SetEvent($request)
{
$mundane_id = Ork3::$Lib->authorization->IsAuthorized($request['Token']);
if (valid_id($mundane_id) && Ork3::$Lib->authorization->HasAuthority($mundane_id, AUTH_EVENT, $request['EventId'], AUTH_EDIT)) {
$this->event->clear();
$this->event->event_id = $request['EventId'];
$response = array();
if (valid_id($request['EventId']) && $this->event->find()) {
if (is_numeric($request['KingdomId'])) {
$this->event->kingdom_id = $request['KingdomId'];
}
if (is_numeric($request['ParkId'])) {
$this->event->park_id = $request['ParkId'];
$p = Ork3::$Lib->park->GetParkShortInfo(array('ParkId' => $request['ParkId']));
if ($p['Status']['Status'] != 0) {
return $p['Status'];
} else {
$this->event->kingdom_id = $p['KingdomId'];
}
}
if (is_numeric($request['MundaneId'])) {
$this->event->mundane_id = $request['MundaneId'];
}
if (is_numeric($request['UnitId'])) {
$this->event->unit_id = $request['UnitId'];
}
if (trimlen($request['Name'])) {
$this->event->name = $request['Name'];
}
$this->event->save();
Ork3::$Lib->heraldry->SetEventHeraldry($request);
logtrace("SetEvent", array($request, $this->event));
return Success();
} else {
return InvalidParameter('Event Id is not a valid id.');
}
} else {
return NoAuthorization();
}
}
示例14: GetParkDays
public function GetParkDays($request)
{
$parkday = new yapo($this->db, DB_PREFIX . 'parkday');
$parkday->clear();
$parkday->park_id = $request['ParkId'];
$response = array('Status' => Success(), 'ParkDays' => array());
if (valid_id($request['ParkId']) && $parkday->find()) {
do {
$response['ParkDays'][] = array('ParkDayId' => $parkday->parkday_id, 'ParkId' => $parkday->park_id, 'Recurrence' => $parkday->recurrence, 'WeekOfMonth' => $parkday->week_of_month, 'WeekDay' => $parkday->week_day, 'MonthDay' => $parkday->month_day, 'Time' => $parkday->time, 'Purpose' => $parkday->purpose, 'Description' => $parkday->description, 'AlternateLocation' => $parkday->alternate_location, 'Address' => $parkday->address, 'City' => $parkday->city, 'Province' => $parkday->province, 'PostalCode' => $parkday->postal_code, 'MapUrl' => $parkday->map_url, 'LocationUrl' => $parkday->location_url);
} while ($parkday->next());
} else {
$response['Status'] = InvalidParameter();
}
return $response;
}
示例15: get_pager_from
function get_pager_from($val)
{
if (isset($val['from']) && valid_id($val['from'])) {
return $val['from'];
}
return 0;
}