Example #1
0
 function deleteokAction()
 {
     $this->_checkToken();
     require_once XOOPS_ROOT_PATH . '/modules/openid/class/context.php';
     $post = new Openid_Context();
     if ($post->accept($this->_keyField)) {
         if ($this->_handler->delete($post->get($this->_keyField))) {
             $message = 'Record Delete Success';
         } else {
             $message = 'Record Delete Error<br />';
             $message .= $this->_handler->getError();
         }
     } else {
         $message = 'Delete key is not specified';
     }
     redirect_header($this->_url, 2, $message);
 }
Example #2
0
 /**
  * Redirect user to OpenID Identity URL
  * using only from xoops userinfo page
  */
 function redirectAction()
 {
     require_once XOOPS_ROOT_PATH . '/modules/openid/class/context.php';
     $request = new Openid_Context();
     if (!$request->accept('id', 'int', 'get') || !$request->accept('displayid', 'string', 'get', 'to')) {
         exit;
     }
     if ($record =& $this->_handler->get($request->get('id'))) {
         $displayid = $record->get('displayid');
         if ($request->get('displayid') == $displayid) {
             if (strpos($displayid, 'http') === 0) {
                 header('Location: ' . $displayid);
                 //control codes are already removed.
             } else {
                 header('Location: http://xri.net/' . rawurlencode($displayid));
             }
         }
     }
 }
Example #3
0
 /**
  * Show Edit or New-create Form
  *
  * @param Openid_Context $record
  * @param string $op
  */
 function _showForm(&$record, $op)
 {
     require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $form = new XoopsThemeForm(_AD_OPENID_LANG_BUTTONS, 'openid_buttons', $this->_url, 'post', true);
     $form->addElement(new XoopsFormHidden('controller', $this->_control));
     $form->addElement(new XoopsFormHidden('op', $op));
     $form->addElement(new XoopsFormText(_AD_OPENID_LANG_DESCRIPTION, 'description', 64, 255, $record->get4Show('description')));
     $form->addElement(new XoopsFormText(_AD_OPENID_LANG_IMAGE, 'image', 64, 255, $record->get4Show('image')));
     if ($op == 'save') {
         $form->addElement(new XoopsFormHidden('id', $record->get4Show('id')));
         $form->addElement(new XoopsFormHidden('type', $record->get4Show('type')));
     } else {
         $element = new XoopsFormRadio(_AD_OPENID_LANG_TYPE, 'type', $record->get4Show('type'));
         $element->addOptionArray(array(_AD_OPENID_LANG_TYPE_SERVER, _AD_OPENID_LANG_TYPE_SINON));
         $form->addElement($element);
     }
     $form->addElement(new XoopsFormText('OpenID Identifier', 'identifier', 64, 255, $record->get4Show('identifier')));
     if ($record->get('type') !== '0') {
         $form->addElement(new XoopsFormText(_AD_OPENID_LANG_RANGE, 'range', 10, 5, $record->get4Show('range')));
     }
     $form->addElement(new XoopsFormButton('', 'submit', 'OK', 'submit'));
     echo $form->render();
 }
Example #4
0
 /**
  * Enter description here...
  *
  * @param Openid_Context $record
  * @param string $op
  */
 function _showForm(&$record, $op)
 {
     $auth = $record->get('auth');
     require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $title = constant('_AD_OPENID_LANG_FILTER_' . $auth);
     $form = new XoopsThemeForm($title, 'openid_filter', $this->_url, 'post', true);
     $form->addElement(new XoopsFormHidden('controller', 'filter'));
     $form->addElement(new XoopsFormHidden('op', $op));
     $form->addElement(new XoopsFormHidden('auth', $auth));
     if ($op == 'save') {
         $form->addElement(new XoopsFormHidden('id', $record->get4Show('id')));
         $form->addElement(new XoopsFormLabel(_AD_OPENID_LANG_PATTERN, $record->get4Show('pattern')));
     } else {
         $form->addElement(new XoopsFormText(_AD_OPENID_LANG_PATTERN, 'pattern', 100, 255, $record->get4Show('pattern')));
     }
     if ($auth) {
         $member_handler =& xoops_gethandler('member');
         $groups = $member_handler->getGroupList();
         $groups = array(_AD_OPENID_LANG_FILTER_DEFAULT) + $groups;
         if ($groupid = $record->get4show('groupid')) {
             $value = explode('|', $groupid);
         } else {
             $value = array(0);
         }
         $element = new XoopsFormSelect(_AD_OPENID_LANG_GROUP, 'groupid', $value, count($groups), true);
         $element->addOptionArray($groups);
         $form->addElement($element);
     }
     $form->addElement(new XoopsFormButton('', 'submit', 'OK', 'submit'));
     echo $form->render();
 }