4 function manage_post(&$a) {
6 if(! local_user() || ! is_array($a->identities))
9 $identity = ((x($_POST['identity'])) ? intval($_POST['identity']) : 0);
13 $r = q("SELECT * FROM `user` WHERE `uid` = %d AND `email` = '%s' AND `password` = '%s' LIMIT 1",
15 dbesc($a->user['email']),
16 dbesc($a->user['password'])
22 unset($_SESSION['authenticated']);
23 unset($_SESSION['uid']);
24 unset($_SESSION['visitor_id']);
25 unset($_SESSION['administrator']);
26 unset($_SESSION['cid']);
27 unset($_SESSION['theme']);
28 unset($_SESSION['page_flags']);
29 unset($_SESSION['return_url']);
32 require_once('include/security.php');
33 authenticate_success($r[0],true,true);
35 goaway($a->get_baseurl() . '/profile/' . $a->user['nickname']);
41 function manage_content(&$a) {
43 if(! local_user() || ! is_array($a->identities)) {
44 notice( t('Permission denied.') . EOL);
48 $r = q("SELECT * FROM `user` WHERE `email` = '%s' AND `password` = '%s'",
49 dbesc($a->user['email']),
50 dbesc($a->user['password'])
56 $o = '<h3>' . t('Manage Identities and/or Pages') . '</h3>';
59 $o .= '<div id="identity-manage-desc">' . t("\x28Toggle between different identities or community/group pages which share your account details.\x29") . '</div>';
61 $o .= '<div id="identity-manage-choose">' . t('Select an identity to manage: ') . '</div>';
63 $o .= '<div id="identity-selector-wrapper">' . "\r\n";
64 $o .= '<form action="manage" method="post" >' . "\r\n";
65 $o .= '<select name="identity" size="4">' . "\r\n";
68 $selected = (($rr['nickname'] === $a->user['nickname']) ? ' selected="selected" ' : '');
69 $o .= '<option ' . $selected . 'value="' . $rr['uid'] . '">' . $rr['username'] . ' (' . $rr['nickname'] . ')</option>' . "\r\n";
72 $o .= '</select>' . "\r\n";
73 $o .= '<div id="identity-select-break"></div>' . "\r\n";
75 $o .= '<input id="identity-submit" type="submit" name="submit" value="' . t('Submit') . '" /></div></form>' . "\r\n";