'profile/ax' => $this->make_hook('ax', AUTH_COOKIE, 'admin,edit_directory'),
'profile/edit' => $this->make_hook('p_edit', AUTH_MDP),
'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/address/del' => $this->make_hook('ajax_address_del', AUTH_MDP),
'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH),
'profile/ajax/edu' => $this->make_hook('ajax_edu', AUTH_COOKIE, 'user', NO_AUTH),
'profile/ajax/medal' => $this->make_hook('ajax_medal', AUTH_COOKIE, 'user', NO_AUTH),
}
$page->setTitle('Mon Profil');
+ $page->assign('hrpid', $profile->hrid());
if (isset($success) && $success) {
$page->trigSuccess('Ton profil a bien été mis à jour.');
}
$page->assign('address', array());
}
+ function handler_ajax_address_del($page, $hrpid)
+ {
+ if ($profile = Profile::get($hrpid)) {
+ if (S::user()->canEdit($profile)) {
+ $address = Post::t('address');
+ if (is_null(AddressReq::get_request($profile->id(), 0, 0, Address::LINK_PROFILE, $address))) {
+ $req = new AddressReq(S::user(), $profile, $address, $profile->id(), 0, 0, Address::LINK_PROFILE);
+ $req->submit();
+ }
+ }
+ }
+ exit();
+ }
+
function handler_ajax_tel($page, $prefid, $prefname, $telid, $subField, $mainField, $mainId)
{
pl_content_headers("text/html");