本文整理汇总了PHP中DAL::updatePerson方法的典型用法代码示例。如果您正苦于以下问题:PHP DAL::updatePerson方法的具体用法?PHP DAL::updatePerson怎么用?PHP DAL::updatePerson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAL
的用法示例。
在下文中一共展示了DAL::updatePerson方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UserException
throw new UserException('Profile not found.');
}
} else {
$person = $user;
}
if ($user['person_id'] !== $person['person_id'] && $user['person_is_moderator'] !== 'y') {
throw new UserException('Moderator login required.');
}
if (isset($_POST['save'])) {
$person['person_first_name'] = $_POST['person_first_name'];
$person['person_last_name'] = $_POST['person_last_name'];
$person['person_organization'] = $_POST['person_organization'];
if ($user['person_is_moderator'] === 'y') {
$person['person_is_moderator'] = $_POST['person_is_moderator'];
}
$dal->updatePerson($person);
$message = 'Saved.';
} else {
if (isset($_POST['subscribe'])) {
$person['person_subscribe'] = 'y';
$dal->updatePerson($person);
$message = 'Subscribed.';
} else {
if (isset($_POST['unsubscribe'])) {
$person['person_subscribe'] = 'n';
$dal->updatePerson($person);
$message = 'Unsubscribed.';
} else {
if (isset($_POST['delete'])) {
if (count($dal->selectUniqueIdsByPersonId($person['person_id'])) > 0) {
throw new UserException('Delete unique id ranges first.');
示例2: array
$person = array('person_first_name' => $_POST['first_name'], 'person_last_name' => $_POST['last_name'], 'person_organization' => $_POST['organization'], 'person_email' => $_POST['email'], 'person_subscribe' => isset($_POST['subscribe']) ? 'y' : 'n', 'person_email_verified' => 'n', 'person_email_shared_secret' => randHex());
setPersonPassword($person, $_POST['password']);
$dal->insertPerson($person);
$url = "http://" . $_SERVER['HTTP_HOST'] . "/register?person_id=" . $person['person_id'] . "&person_email_shared_secret=" . $person['person_email_shared_secret'] . '&verify';
$name = formatPersonName($person);
$email = formatPersonEmail($person);
$subject = "Register as OpenLCB User";
$body = "Hi {$name},\r\n\r\nYou can verify your email address with the link below.\r\n{$url}\r\n\r\nThe OpenLCB Group";
if (!mail_abstraction(array($email), $subject, $body)) {
throw new UserError('Failed to send email.');
}
$message = 'Registered and verification email sent.';
} else {
if (isset($_GET['verify'])) {
$user['person_email_verified'] = 'y';
$dal->updatePerson($user);
$message = 'Email address verified.';
} else {
if ($user !== null) {
header('Location: .');
exit;
}
}
}
$dal->commit();
} catch (UserException $e) {
$dal->rollback();
$error = $e->getMessage();
} catch (Exception $e) {
$dal->rollback();
throw $e;