本文整理汇总了PHP中People::UpdatePerson方法的典型用法代码示例。如果您正苦于以下问题:PHP People::UpdatePerson方法的具体用法?PHP People::UpdatePerson怎么用?PHP People::UpdatePerson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::UpdatePerson方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
$response = array();
$p = new People();
$p->PersonID = $personid;
if (!$p->GetPerson()) {
$response['error'] = true;
$response['errorcode'] = 404;
$response['message'] = __("User not found in database.");
echoResponse(200, $response);
} else {
// Slim Framework will simply return null for any variables that were not passed, so this is safe to call without blowing up the script
foreach ($p as $prop) {
$p->{$prop} = $app->request->post($prop);
}
$p->Disabled = false;
if (!$p->UpdatePerson()) {
$response['error'] = true;
$response['errorcode'] = 403;
$response['message'] = __("Unable to update People resource with the given parameters.");
echoResponse(200, $response);
} else {
$response['error'] = false;
$response['errorcode'] = 200;
$response['message'] = sprintf(__('People resource for UserID=%1$s updated successfully.'), $p->UserID);
$response['people'] = $p;
echoResponse(200, $response);
}
}
});
//
// URL: /api/v1/people
示例2: isset
$userRights->ReadAccess = isset($_POST['ReadAccess']) ? 1 : 0;
$userRights->WriteAccess = isset($_POST['WriteAccess']) ? 1 : 0;
$userRights->DeleteAccess = isset($_POST['DeleteAccess']) ? 1 : 0;
$userRights->ContactAdmin = isset($_POST['ContactAdmin']) ? 1 : 0;
$userRights->RackRequest = isset($_POST['RackRequest']) ? 1 : 0;
$userRights->RackAdmin = isset($_POST['RackAdmin']) ? 1 : 0;
$userRights->SiteAdmin = isset($_POST['SiteAdmin']) ? 1 : 0;
$userRights->Disabled = isset($_POST['Disabled']) ? 1 : 0;
if ($_POST['action'] == 'Create') {
$userRights->CreatePerson();
// We've, hopefully, successfully created a new device. Force them to the new device page.
header('Location: ' . redirect("usermgr.php?PersonID={$userRights->PersonID}"));
exit;
} else {
$status = __("Updated");
$userRights->UpdatePerson();
}
} else {
//Should we ever add a delete user function it will go here
}
// Reload rights because actions like disable reset other rights
$userRights->GetUserRights();
}
$userList = $userRights->GetUserList();
$adminown = $userRights->AdminOwnDevices ? "checked" : "";
$read = $userRights->ReadAccess ? "checked" : "";
$write = $userRights->WriteAccess ? "checked" : "";
$delete = $userRights->DeleteAccess ? "checked" : "";
$contact = $userRights->ContactAdmin ? "checked" : "";
$request = $userRights->RackRequest ? "checked" : "";
$RackAdmin = $userRights->RackAdmin ? "checked" : "";