*/ /** * Class enabling users to manage their claimed identities. * * @author Aoi Karasu */ class fa_manage extends fa_login { /** * Creates the class instance bound to a plugin instance and an authentication provider. * * @param objref $manager object reference to the admin plugin * @param string $cmd name of the command to handle * @param string $provid (optional) an authentication provider id */ function __construct(&$manager, $cmd, $provid='') { parent::__construct(&$manager, $cmd, $provid); } /** * No pocessing for the time being. * This method is intended to suppress the 'unknown command' message only. */ function process_manage() { $this->success = true; return null; } /** * Renders the user identities management page. */ function html_manage() { // print "
".print_r($_REQUEST, true)."
"; $out = $this->manager->locale_xhtml('mylogins'); $out = str_replace('@MYLOGINSLIST@', $this->html_mylogins_form(), $out); print $out; $this->html_login_service_from(); } /** * Renders the user's identities associated with his wiki account. */ function html_mylogins_form() { global $ID; $out = '
' . ' ' . '
' . $this->html_mylogins_list() . '
' . '
'; return $out; } function html_mylogins_list() { // global $conf; $even = false; // TODO: sanity checks $store = $this->getUserStore(); $data =& $store->getUserData(); // $out = "
".print_r($data, true)."
"; $current = isset($_SESSION[DOKU_COOKIE]['fedauth']) ? $_SESSION[DOKU_COOKIE]['fedauth']['prid'] : ''; foreach ($data as $entry) { $id = $entry['id']; $pro = $this->manager->providers->get($id); $class = $even = !$even ? ' class="even"' : ''; $using = $id == $current ? '('.$this->manager->getLang('inuse').')' : ''; $out .= ' ' . ' '.$id.'' . '
' . $using . '
'.$entry['ident'].'
' . ' '.dformat($entry['last']).'' . $this->_html_button($id, base64_encode($entry['ident']),'remove', $id == $current, 6) . ' '; } return $out; } function _html_button($provid, $aid, $btn, $disabled=false, $indent=0, $class='') { $disabled = ($disabled) ? 'disabled="disabled"' : ''; return str_repeat(' ', $indent) . ''; } } /* fa_manage */ /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */