Ejemplo n.º 1
0
}
// build the html select list
$lists['block'] = vmCommonHTML::yesnoRadioList('block', 'class="inputbox" size="1"', 'value', 'text', $row->block);
// build the html select list
$lists['sendEmail'] = vmCommonHTML::yesnoRadioList('sendEmail', 'class="inputbox" size="1"', 'value', 'text', $row->sendEmail);
$canBlockUser = $acl->acl_check('administration', 'edit', 'users', $my->usertype, 'user properties', 'block_user');
$canEmailEvents = $acl->acl_check('workflow', 'email_events', 'users', $acl->get_group_name($row->gid, 'ARO'));
// Get the user parameters
if (vmIsJoomla('1.5')) {
    require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'users.class.php';
    $user =& JUser::getInstance($user_id);
    $params = $user->getParameters(true);
} elseif (file_exists($mosConfig_absolute_path . '/administrator/components/com_users/users.class.php')) {
    require_once $mosConfig_absolute_path . '/administrator/components/com_users/users.class.php';
    $file = $mainframe->getPath('com_xml', 'com_users');
    $params = new mosUserParameters($row->params, $file, 'component');
}
// Set the last visit date
$lvisit = $row->lastvisitDate;
if ($lvisit == "0000-00-00 00:00:00") {
    $lvisit = '***' . $VM_LANG->_('VM_USER_FORM_LASTVISIT_NEVER');
}
//First create the object and let it print a form heading
$formObj = new formFactory(vmCommonHTML::imageTag(VM_THEMEURL . 'images/administration/header/icon-48-user.png', 'User Icon', 'absmiddle') . '   ' . $VM_LANG->_('PHPSHOP_USER_FORM_LBL'));
//Then Start the form
$formObj->startForm();
$tabs = new vmTabPanel(0, 1, "userform");
$tabs->startPane("userform-pane");
$tabs->startTab($VM_LANG->_('VM_USER_FORM_TAB_GENERALINFO'), "userform-page");
?>
<script language="javascript" type="text/javascript">
Ejemplo n.º 2
0
 /**
  * Retrieve joomla standard user parameters so that they can be displayed in user edit mode.
  * @param  int                 $ui        1 for front-end, 2 for back-end
  * @param  moscomprofilerUser  $user      the user being displayed
  * @param  string              $name      Name of variable
  * @return array of user parameter attributes (title,value)
  */
 function _getUserParams($ui, $user, $name = "params")
 {
     global $_CB_framework;
     $result = array();
     // in case not Joomla
     if (class_exists("JUser")) {
         // Joomla 1.5 and 1.6:
         if ($user->id) {
             $juser = JUser::getInstance($user->id);
         } else {
             $juser = JUser::getInstance();
         }
         if (checkJversion() == 2) {
             // Joomla 1.6:
             $result = array();
             jimport('joomla.form.form');
             JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_users/models/forms');
             $form = JForm::getInstance('com_users.params', 'user', array('load_data' => true));
             $params = $juser->getParameters(true)->toArray();
             if ($params) {
                 foreach ($params as $k => $v) {
                     $form->setValue($k, 'params', $v);
                 }
             }
             $fields = $form->getFieldset('settings');
             if ($fields) {
                 foreach ($fields as $field) {
                     $admin_field = strpos($field->name, 'admin') || strpos($field->name, 'help');
                     if ($admin_field && ($juser->authorise('canManageUsers') || !$user->id) || !$admin_field) {
                         $result[] = array($field->label, $field->input, $field->description, $field->name);
                     }
                 }
             }
         } else {
             // Joomla 1.5:
             $params =& $juser->getParameters(true);
             // $result = $params->render( 'params' );
             if (is_callable(array($params, "getParams"))) {
                 $result = $params->getParams($name);
                 //BBB new API submited to Jinx 17.4.2006.
             } else {
                 foreach ($params->_xml->param as $param) {
                     //BBB still needs core help... accessing private variable _xml .
                     $result[] = $params->renderParam($param, $name);
                 }
             }
         }
     } else {
         if (file_exists($_CB_framework->getCfg('absolute_path') . '/administrator/components/com_users/users.class.php')) {
             require_once $_CB_framework->getCfg('absolute_path') . '/administrator/components/com_users/users.class.php';
         }
         if (class_exists('mosUserParameters')) {
             // Joomla 1.0 :
             global $mainframe;
             $file = $mainframe->getPath('com_xml', 'com_users');
             $userParams = new mosUserParameters($user->params, $file, 'component');
             if (isset($userParams->_path) && $userParams->_path) {
                 // Joomla 1.0
                 if (!is_object($userParams->_xmlElem)) {
                     require_once $_CB_framework->getCfg('absolute_path') . '/includes/domit/xml_domit_lite_include.php';
                     $xmlDoc = new DOMIT_Lite_Document();
                     $xmlDoc->resolveErrors(true);
                     if ($xmlDoc->loadXML($userParams->_path, false, true)) {
                         $root =& $xmlDoc->documentElement;
                         $tagName = $root->getTagName();
                         $isParamsFile = $tagName == 'mosinstall' || $tagName == 'mosparams';
                         if ($isParamsFile && $root->getAttribute('type') == $userParams->_type) {
                             $params =& $root->getElementsByPath('params', 1);
                             if ($params) {
                                 $userParams->_xmlElem =& $params;
                             }
                         }
                     }
                 }
             }
             $result = array();
             if (isset($userParams->_xmlElem) && is_object($userParams->_xmlElem)) {
                 // Joomla 1.0
                 $element =& $userParams->_xmlElem;
                 //$params = mosParseParams( $row->params );
                 $userParams->_methods = get_class_methods("mosUserParameters");
                 foreach ($element->childNodes as $param) {
                     $result[] = $userParams->renderParam($param, $name);
                 }
             }
         }
     }
     return $result;
 }