00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 unset($MCONF);
00062 require('conf.php');
00063 require($BACK_PATH.'init.php');
00064 require_once(PATH_t3lib.'class.t3lib_tcemain.php');
00065 require_once(PATH_t3lib.'class.t3lib_loadmodules.php');
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 class SC_mod_user_setup_index {
00088
00089
00090 var $MCONF = array();
00091 var $MOD_MENU = array();
00092 var $MOD_SETTINGS = array();
00093
00094
00095
00096
00097
00098
00099 var $doc;
00100
00101 var $content;
00102 var $overrideConf;
00103
00104
00105
00106
00107
00108
00109 var $OLD_BE_USER;
00110 var $languageUpdate;
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 function storeIncomingData() {
00129 global $BE_USER;
00130
00131
00132
00133 $d = t3lib_div::_POST('data');
00134 if (is_array($d)) {
00135
00136
00137 $save_before = md5(serialize($BE_USER->uc));
00138
00139
00140
00141
00142 if (isset($d['lang']) && ($d['lang'] != $BE_USER->uc['lang'])) {
00143 $this->languageUpdate = true;
00144 }
00145
00146 $BE_USER->uc['lang'] = $d['lang'];
00147
00148
00149 $BE_USER->uc['condensedMode'] = $d['condensedMode'];
00150 $BE_USER->uc['noMenuMode'] = $d['noMenuMode'];
00151 $BE_USER->uc['startModule'] = $d['startModule'];
00152 $BE_USER->uc['thumbnailsByDefault'] = $d['thumbnailsByDefault'];
00153 $BE_USER->uc['helpText'] = $d['helpText'];
00154 $BE_USER->uc['titleLen'] = intval($d['titleLen']);
00155
00156
00157 $BE_USER->uc['copyLevels'] = t3lib_div::intInRange($d['copyLevels'],0,100);
00158 $BE_USER->uc['recursiveDelete'] = $d['recursiveDelete'];
00159
00160
00161 $BE_USER->uc['edit_wideDocument'] = $d['edit_wideDocument'];
00162 if ($GLOBALS['TYPO3_CONF_VARS']['BE']['RTEenabled']) { $BE_USER->uc['edit_RTE'] = $d['edit_RTE']; }
00163 $BE_USER->uc['edit_docModuleUpload'] = $d['edit_docModuleUpload'];
00164 $BE_USER->uc['edit_showFieldHelp'] = $d['edit_showFieldHelp'];
00165 $BE_USER->uc['disableCMlayers'] = $d['disableCMlayers'];
00166
00167
00168 $BE_USER->uc['emailMeAtLogin'] = $d['emailMeAtLogin'];
00169
00170
00171 if ($d['setValuesToDefault']) {
00172 $BE_USER->resetUC();
00173 }
00174 $BE_USER->overrideUC();
00175
00176 $save_after = md5(serialize($BE_USER->uc));
00177 if ($save_before!=$save_after) {
00178 $BE_USER->writeUC($BE_USER->uc);
00179 $BE_USER->writelog(254,1,0,1,'Personal settings changed',Array());
00180 }
00181
00182
00183
00184
00185 $be_user_data = t3lib_div::_GP('ext_beuser');
00186 $this->PASSWORD_UPDATED = strlen($be_user_data['password1'].$be_user_data['password2'])>0 ? -1 : 0;
00187 if ($be_user_data['email']!=$BE_USER->user['email']
00188 || $be_user_data['realName']!=$BE_USER->user['realName']
00189 || (strlen($be_user_data['password1'])==32
00190 && !strcmp($be_user_data['password1'],$be_user_data['password2']))
00191 ) {
00192 $storeRec = array();
00193 $BE_USER->user['realName'] = $storeRec['be_users'][$BE_USER->user['uid']]['realName'] = substr($be_user_data['realName'],0,80);
00194 $BE_USER->user['email'] = $storeRec['be_users'][$BE_USER->user['uid']]['email'] = substr($be_user_data['email'],0,80);
00195 if (strlen($be_user_data['password1'])==32 && !strcmp($be_user_data['password1'],$be_user_data['password2'])) {
00196 $BE_USER->user['password'] = $storeRec['be_users'][$BE_USER->user['uid']]['password'] = $be_user_data['password1'];
00197 $this->PASSWORD_UPDATED = 1;
00198 }
00199
00200
00201 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
00202 $tce->stripslashes_values=0;
00203 $tce->start($storeRec,Array(),$BE_USER);
00204 $tce->admin = 1;
00205 $tce->bypassWorkspaceRestrictions = TRUE;
00206 $tce->process_datamap();
00207 unset($tce);
00208 }
00209 }
00210 }
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234 function init() {
00235 global $BE_USER,$BACK_PATH;
00236 $this->MCONF = $GLOBALS['MCONF'];
00237
00238
00239 $scriptUser = $this->getRealScriptUserObj();
00240 $scriptUser->modAccess($this->MCONF,1);
00241
00242
00243 $this->overrideConf = $BE_USER->getTSConfigProp('setup.override');
00244
00245
00246 $this->doc = t3lib_div::makeInstance('template');
00247 $this->doc->backPath = $BACK_PATH;
00248 $this->doc->setModuleTemplate('templates/setup.html');
00249 $this->doc->JScodeLibArray['dyntabmenu'] = $this->doc->getDynTabMenuJScode();
00250
00251 $this->doc->form = '<form action="index.php" method="post" name="usersetup" enctype="application/x-www-form-urlencoded">';
00252 $this->doc->tableLayout = array (
00253 'defRow' => array (
00254 '0' => array('<td class="td-label">','</td>'),
00255 '2' => array('<td class="td-label-right">','</td>'),
00256 'defCol' => array('<td valign="top">','</td>')
00257 )
00258 );
00259 $this->doc->table_TR = '<tr>';
00260 $this->doc->table_TABLE = '<table border="0" cellspacing="1" cellpadding="2" id="typo3-userSettings">';
00261 }
00262
00263
00264
00265
00266
00267
00268 function main() {
00269 global $BE_USER,$LANG,$BACK_PATH,$TBE_MODULES;
00270
00271 if ($this->languageUpdate) {
00272 $this->doc->JScode.= '<script language="javascript" type="text/javascript">
00273 if(top.refreshMenu) {
00274 top.refreshMenu();
00275 } else {
00276 top.TYPO3ModuleMenu.refreshMenu();
00277 }
00278
00279 if(top.shortcutFrame) {
00280 top.shortcutFrame.refreshShortcuts();
00281 }
00282 </script>';
00283 }
00284
00285
00286 $menuItems = array();
00287 $this->doc->loadJavascriptLib('md5.js');
00288
00289
00290 $this->content .= '<div id="user-setup-wrapper">';
00291
00292
00293 $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
00294 $this->loadModules->observeWorkspaces = TRUE;
00295 $this->loadModules->load($TBE_MODULES);
00296
00297 $this->content .= $this->doc->header($LANG->getLL('UserSettings').' - '.$BE_USER->user['realName'].' ['.$BE_USER->user['username'].']');
00298
00299
00300 if ($this->PASSWORD_UPDATED) {
00301 if ($this->PASSWORD_UPDATED>0) {
00302 $this->content .= $this->doc->section($LANG->getLL('newPassword').':',$LANG->getLL('newPassword_ok'),1,0,1);
00303 } else {
00304 $this->content .= $this->doc->section($LANG->getLL('newPassword').':',$LANG->getLL('newPassword_failed'),1,0,2);
00305 }
00306 $this->content .= $this->doc->spacer(25);
00307 }
00308
00309
00310 $displayFullText = ($BE_USER->uc['edit_showFieldHelp'] == 'text');
00311 if ($displayFullText) {
00312 $this->doc->tableLayout['defRowEven'] = array ('defCol' => array ('<td valign="top" colspan="3">','</td>'));
00313 }
00314
00315
00316 $code = array();
00317 $i = 0;
00318
00319 if ($displayFullText) {
00320 $code[$i++][1] = $this->getCSH('beUser_realName');
00321
00322 }
00323 $code[$i][1] = $this->setLabel('beUser_realName');
00324 $code[$i][2] = '<input id="field_beUser_realName" type="text" name="ext_beuser[realName]" value="'.htmlspecialchars($BE_USER->user['realName']).'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' />';
00325 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('beUser_realName');
00326
00327 if ($displayFullText) {
00328 $code[$i++][1] = $this->getCSH('beUser_email');
00329 }
00330 $code[$i][1] = $this->setLabel('beUser_email');
00331 $code[$i][2] = '<input id="field_beUser_email" type="text" name="ext_beuser[email]" value="'.htmlspecialchars($BE_USER->user['email']).'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' />';
00332 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('beUser_email');
00333
00334 if ($displayFullText) {
00335 $code[$i++][1] = $this->getCSH('emailMeAtLogin');
00336 }
00337 $code[$i][1] = $this->setLabel('emailMeAtLogin').($BE_USER->user['email'] ? ' ('.$BE_USER->user['email'].')' : '');
00338 $code[$i][2] = '<input id="field_emailMeAtLogin" type="checkbox" name="data[emailMeAtLogin]"'.($BE_USER->uc['emailMeAtLogin']?' checked="checked"':'').' />';
00339 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('emailMeAtLogin');
00340
00341 if ($displayFullText) {
00342 $code[$i++][1] = $this->getCSH('newPassword');
00343 }
00344 $code[$i][1] = $this->setLabel('newPassword');
00345 $code[$i][2] = '<input id="field_newPassword" type="password" name="ext_beuser[password1]" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' onchange="this.value=this.value?MD5(this.value):\'\';" />';
00346 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('newPassword');
00347
00348 if ($displayFullText) {
00349 $code[$i++][1] = $this->getCSH('newPasswordAgain');
00350 }
00351 $code[$i][1] = $this->setLabel('newPasswordAgain');
00352 $code[$i][2] = '<input id="field_newPasswordAgain" type="password" name="ext_beuser[password2]" value=""'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' onchange="this.value=this.value?MD5(this.value):\'\'" />';
00353 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('newPasswordAgain');
00354
00355
00356 $opt = array();
00357 $opt['000000000']='
00358 <option value="">'.$LANG->getLL('lang_default',1).'</option>';
00359 $theLanguages = t3lib_div::trimExplode('|',TYPO3_languages);
00360
00361
00362 $csConvObj = t3lib_div::makeInstance('t3lib_cs');
00363
00364
00365 foreach($theLanguages as $val) {
00366 if ($val!='default') {
00367 $localLabel = ' - ['.htmlspecialchars($GLOBALS['LOCAL_LANG']['default']['lang_'.$val]).']';
00368 $unavailable = $val!='default' && !@is_dir(PATH_typo3conf.'l10n/'.$val) ? '1' : '';
00369 if (!$unavailable) $opt[$GLOBALS['LOCAL_LANG']['default']['lang_'.$val].'--'.$val]='
00370 <option value="'.$val.'"'.($BE_USER->uc['lang']==$val?' selected="selected"':'').($unavailable ? ' class="c-na"' : '').'>'.$LANG->getLL('lang_'.$val,1).$localLabel.'</option>';
00371 }
00372 }
00373 ksort($opt);
00374 $languageCode = '
00375 <select id="field_language" name="data[lang]">'.
00376 implode('',$opt).'
00377 </select>';
00378 if ($BE_USER->uc['lang'] && !@is_dir(PATH_typo3conf.'l10n/'.$BE_USER->uc['lang'])) {
00379 $languageCode.= '<table border="0" cellpadding="0" cellspacing="0" class="warningbox"><tr><td>'.
00380 $this->doc->icons(3).
00381 'The selected language is not available before the language pack is installed.<br />'.
00382 ($BE_USER->isAdmin()? 'You can use the Extension Manager to easily download and install new language packs.':'Please ask your system administrator to do this.').
00383 '</td></tr></table>';
00384 }
00385
00386
00387 if ($displayFullText) {
00388 $code[$i++][1] = t3lib_BEfunc::cshItem('_MOD_user_setup', 'language', $BACK_PATH);
00389 }
00390 $code[$i][1] = $this->setLabel('language');
00391 $code[$i][2] = $languageCode;
00392 $code[$i++][3] = $displayFullText ? ' ' : t3lib_BEfunc::cshItem('_MOD_user_setup', 'language', $BACK_PATH);
00393
00394 $menuItems[] = array(
00395 'label' => $LANG->getLL('language').' & '.$LANG->getLL('personal_data'),
00396 'content' => $this->doc->spacer(20).$this->doc->table($code)
00397 );
00398
00399
00400
00401
00402 $code = array();
00403 $i = 0;
00404
00405 if ($displayFullText) {
00406 $code[$i++][1] = $this->getCSH('condensedMode');
00407 }
00408 $code[$i][1] = $this->setLabel('condensedMode','condensedMode');
00409 $code[$i][2] = '<input id="field_condensedMode" type="checkbox" name="data[condensedMode]"'.($BE_USER->uc['condensedMode']?' checked="checked"':'').' />';
00410 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('condensedMode');
00411
00412 if($GLOBALS['BE_USER']->uc['interfaceSetup'] == 'backend_old') {
00413 $code[$i][1] = $this->setLabel('noMenuMode','noMenuMode');
00414 $code[$i][2] = '<select id="field_noMenuMode" name="data[noMenuMode]">
00415 <option value=""'.(!$BE_USER->uc['noMenuMode']?' selected="selected"':'').'>'.$LANG->getLL('noMenuMode_def').'</option>
00416 <option value="1"'.($BE_USER->uc['noMenuMode'] && (string)$BE_USER->uc['noMenuMode']!="icons"?' selected="selected"':'').'>'.$LANG->getLL('noMenuMode_sel').'</option>
00417 <option value="icons"'.((string)$BE_USER->uc['noMenuMode']=='icons'?' selected="selected"':'').'>'.$LANG->getLL('noMenuMode_icons').'</option>
00418 </select>';
00419 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('noMenuMode');
00420 }
00421
00422 if ($displayFullText) {
00423 $code[$i++][1] = $this->getCSH('startModule');
00424 }
00425 $code[$i][1] = $this->setLabel('startModule','startModule');
00426 $modSelect = '<select id="field_startModule" name="data[startModule]">';
00427 $modSelect .= '<option value=""></option>';
00428 if (empty($BE_USER->uc['startModule'])) {
00429 $BE_USER->uc['startModule'] = $BE_USER->uc_default['startModule'];
00430 }
00431 foreach ($this->loadModules->modules as $mainMod => $modData) {
00432 if (isset($modData['sub']) && is_array($modData['sub'])) {
00433 $modSelect .= '<option disabled="disabled">'.$LANG->moduleLabels['tabs'][$mainMod.'_tab'].'</option>';
00434 foreach ($modData['sub'] as $subKey => $subData) {
00435 $modName = $subData['name'];
00436 $modSelect .= '<option value="'.$modName.'"'.($BE_USER->uc['startModule']==$modName?' selected="selected"':'').'>';
00437 $modSelect .= ' - '.$LANG->moduleLabels['tabs'][$modName.'_tab'].'</option>';
00438 }
00439 }
00440 }
00441 $modSelect .= '</select>';
00442 $code[$i][2] = $modSelect;
00443 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('startModule');
00444
00445 if ($displayFullText) {
00446 $code[$i++][1] = $this->getCSH('showThumbs');
00447 }
00448 $code[$i][1] = $this->setLabel('showThumbs','thumbnailsByDefault');
00449 $code[$i][2] = '<input id="field_showThumbs" type="checkbox" name="data[thumbnailsByDefault]"'.($BE_USER->uc['thumbnailsByDefault']?' checked="checked"':'').' />';
00450 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('showThumbs');
00451
00452 if ($displayFullText) {
00453 $code[$i++][1] = $this->getCSH('helpText');
00454 }
00455 $code[$i][1] = $this->setLabel('helpText');
00456 $code[$i][2] = '<input id="field_helpText" type="checkbox" name="data[helpText]"'.($BE_USER->uc['helpText']?' checked="checked"':'').' />';
00457 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('helpText');
00458
00459 if ($displayFullText) {
00460 $code[$i++][1] = $this->getCSH('edit_showFieldHelp');
00461 }
00462 $code[$i][1] = $this->setLabel('edit_showFieldHelp');
00463 $code[$i][2] = '<select id="field_edit_showFieldHelp" name="data[edit_showFieldHelp]">
00464 <option value="">'.$LANG->getLL('edit_showFieldHelp_none').'</option>
00465 <option value="icon"'.($BE_USER->uc['edit_showFieldHelp']=='icon'?' selected="selected"':'').'>'.$LANG->getLL('edit_showFieldHelp_icon').'</option>
00466 <option value="text"'.($BE_USER->uc['edit_showFieldHelp']=='text'?' selected="selected"':'').'>'.$LANG->getLL('edit_showFieldHelp_message').'</option>
00467 </select>';
00468 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('edit_showFieldHelp');
00469
00470 if ($displayFullText) {
00471 $code[$i++][1] = $this->getCSH('maxTitleLen');
00472 }
00473 $code[$i][1] = $this->setLabel('maxTitleLen','titleLen');
00474 $code[$i][2] = '<input id="field_maxTitleLen" type="text" name="data[titleLen]" value="'.$BE_USER->uc['titleLen'].'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(5).' maxlength="5" />';
00475 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('maxTitleLen');
00476
00477 $menuItems[] = array(
00478 'label' => $LANG->getLL('opening'),
00479 'content' => $this->doc->spacer(20).$this->doc->table($code)
00480 );
00481
00482
00483
00484 $code = array();
00485 $i = 0;
00486
00487 if ($GLOBALS['TYPO3_CONF_VARS']['BE']['RTEenabled']) {
00488 if ($displayFullText) {
00489 $code[$i++][1] = $this->getCSH('edit_RTE');
00490 }
00491 $code[$i][1] = $this->setLabel('edit_RTE');
00492 $code[$i][2] = '<input id="field_edit_RTE" type="checkbox" name="data[edit_RTE]"'.($BE_USER->uc['edit_RTE']?' checked="checked"':'').' />';
00493 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('edit_RTE');
00494 }
00495
00496 if ($displayFullText) {
00497 $code[$i++][1] = $this->getCSH('edit_docModuleUpload');
00498 }
00499 $code[$i][1] = $this->setLabel('edit_docModuleUpload');
00500 $code[$i][2] = '<input id="field_edit_docModuleUpload" type="checkbox" name="data[edit_docModuleUpload]"'.($BE_USER->uc['edit_docModuleUpload']?' checked="checked"':'').' />';
00501 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('edit_docModuleUpload');
00502
00503 if ($displayFullText) {
00504 $code[$i++][1] = $this->getCSH('disableCMlayers');
00505 }
00506 $code[$i][1] = $this->setLabel('disableCMlayers');
00507 $code[$i][2] = '<input id="field_disableCMlayers" type="checkbox" name="data[disableCMlayers]"'.($BE_USER->uc['disableCMlayers']?' checked="checked"':'').' />';
00508 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('disableCMlayers');
00509
00510
00511
00512 if ($displayFullText) {
00513 $code[$i++][1] = $this->getCSH('copyLevels');
00514 }
00515 $code[$i][1] = $this->setLabel('copyLevels');
00516 $code[$i][2] = '<input id="field_copyLevels" type="text" name="data[copyLevels]" value="'.$BE_USER->uc['copyLevels'].'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(5).' maxlength="5" /> '.$LANG->getLL('levels');
00517 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('copyLevels');
00518
00519 if ($displayFullText) {
00520 $code[$i++][1] = $this->getCSH('recursiveDelete');
00521 }
00522 $code[$i][1] = $this->setLabel('recursiveDelete');
00523 $code[$i][2] = '<input id="field_recursiveDelete" type="checkbox" name="data[recursiveDelete]"'.($BE_USER->uc['recursiveDelete']?' checked="checked"':'').' />';
00524 $code[$i++][3] = $displayFullText ? ' ' : $this->getCSH('recursiveDelete');
00525
00526 $menuItems[] = array(
00527 'label' => $LANG->getLL('edit_functions') . ' & ' . $LANG->getLL('functions'),
00528 'content' => $this->doc->spacer(20).$this->doc->table($code)
00529 );
00530
00531
00532 $code = array();
00533 $i = 0;
00534
00535
00536 if($BE_USER->isAdmin()) {
00537
00538 if ($this->simulateSelector) {
00539 if ($displayFullText) {
00540 $code[$i++][1] = t3lib_BEfunc::cshItem('_MOD_user_setup', 'simuser', $BACK_PATH);
00541 }
00542 $code[$i][1] = $this->setLabel('simulate');
00543 $code[$i][2] = $this->simulateSelector;
00544 $code[$i++][3] = $displayFullText ? ' ' : t3lib_BEfunc::cshItem('_MOD_user_setup', 'simuser', $BACK_PATH);
00545 }
00546
00547 $menuItems[] = array(
00548 'label' => $LANG->getLL('adminFunctions'),
00549 'content' => $this->doc->spacer(20).$this->doc->table($code)
00550 );
00551 }
00552
00553 $this->content .= $this->doc->spacer(20);
00554 $this->content .= $this->doc->getDynTabMenu($menuItems, 'user-setup', false, false, 100);
00555
00556
00557
00558 $this->content .= $this->doc->spacer(20);
00559 $this->content .= $this->doc->section('','
00560 <input type="hidden" name="simUser" value="'.$this->simUser.'" />
00561 <input type="submit" name="submit" value="'.$LANG->getLL('save').'" />
00562 <input type="submit" name="data[setValuesToDefault]" value="'.$LANG->getLL('setToStandard').'" onclick="return confirm(\''.$LANG->getLL('setToStandardQuestion').'\');" />'.
00563 t3lib_BEfunc::cshItem('_MOD_user_setup', 'reset', $BACK_PATH)
00564 );
00565
00566
00567 $this->content .= $this->doc->spacer(30);
00568 $this->content .= $this->doc->section('', $LANG->getLL('activateChanges'));
00569
00570
00571 $docHeaderButtons = $this->getButtons();
00572 $markers['CSH'] = $docHeaderButtons['csh'];
00573 $markers['CONTENT'] = $this->content;
00574
00575
00576 $this->content = $this->doc->startPage($LANG->getLL('UserSettings'));
00577 $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
00578 $this->content.= $this->doc->endPage();
00579 $this->content = $this->doc->insertStylesAndJS($this->content);
00580
00581
00582 $this->content .= '</div>';
00583 }
00584
00585
00586
00587
00588
00589
00590 function printContent() {
00591 echo $this->content;
00592 }
00593
00594
00595
00596
00597
00598
00599 protected function getButtons() {
00600 global $LANG, $BACK_PATH, $BE_USER;
00601
00602 $buttons = array(
00603 'csh' => '',
00604 'save' => '',
00605 'shortcut' => '',
00606 );
00607
00608
00609 $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_user_setup', '', $BACK_PATH, '|', TRUE);
00610
00611 if ($BE_USER->mayMakeShortcut()) {
00612
00613 $buttons['shortcut'] = $this->doc->makeShortcutIcon('','',$this->MCONF['name']);
00614 }
00615
00616 return $buttons;
00617 }
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640 function getRealScriptUserObj() {
00641 return is_object($this->OLD_BE_USER) ? $this->OLD_BE_USER : $GLOBALS['BE_USER'];
00642 }
00643
00644
00645
00646
00647
00648
00649
00650 function simulateUser() {
00651 global $BE_USER,$LANG,$BACK_PATH;
00652
00653
00654
00655
00656 $this->simUser = 0;
00657 $this->simulateSelector = '';
00658 unset($this->OLD_BE_USER);
00659 if ($BE_USER->isAdmin()) {
00660 $this->simUser = t3lib_div::_GP('simUser');
00661
00662
00663 $users = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,realName');
00664 $opt = array();
00665 reset($users);
00666 $opt[] = '<option></option>';
00667 while(list(,$rr)=each($users)) {
00668 if ($rr['uid']!=$BE_USER->user['uid']) {
00669 $opt[] = '<option value="'.$rr['uid'].'"'.($this->simUser==$rr['uid']?' selected="selected"':'').'>'.htmlspecialchars($rr['username'].' ('.$rr['realName'].')').'</option>';
00670 }
00671 }
00672 $this->simulateSelector = '<select id="field_simulate" name="simulateUser" onchange="window.location.href=\'index.php?simUser=\'+this.options[this.selectedIndex].value;">'.implode('',$opt).'</select>';
00673 }
00674
00675 if ($this->simUser>0) {
00676 $this->OLD_BE_USER = $BE_USER;
00677 unset($BE_USER);
00678
00679 $BE_USER = t3lib_div::makeInstance('t3lib_beUserAuth');
00680 $BE_USER->OS = TYPO3_OS;
00681 $BE_USER->setBeUserByUid($this->simUser);
00682 $BE_USER->fetchGroupData();
00683 $BE_USER->backendSetUC();
00684 $GLOBALS['BE_USER'] = $BE_USER;
00685 }
00686 }
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697 function setLabel($str, $key='', $addLabelTag=true, $altLabelTagId='') {
00698 $out = $GLOBALS['LANG']->getLL($str) . ': ';
00699 if (isset($this->overrideConf[($key?$key:$str)])) {
00700 $out = '<span style="color:#999999">'.$out.'</span>';
00701 }
00702 if($addLabelTag) {
00703 $out = '<label for="'.($altLabelTagId?$altLabelTagId:'field_'.$str).'">'.$out.'</label>';
00704 }
00705 return $out;
00706 }
00707
00708
00709
00710
00711
00712
00713
00714 function getCSH($str) {
00715 return t3lib_BEfunc::cshItem('_MOD_user_setup', 'option_'.$str, $GLOBALS['BACK_PATH'],'|',FALSE,'margin-bottom:0px;');
00716 }
00717 }
00718
00719
00720 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/setup/mod/index.php']) {
00721 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/setup/mod/index.php']);
00722 }
00723
00724
00725
00726
00727 $SOBE = t3lib_div::makeInstance('SC_mod_user_setup_index');
00728 $SOBE->simulateUser();
00729 $SOBE->storeIncomingData();
00730
00731
00732 require ($BACK_PATH.'template.php');
00733 $LANG->includeLLFile('EXT:setup/mod/locallang.xml');
00734
00735 $SOBE->init();
00736 $SOBE->main();
00737 $SOBE->printContent();
00738
00739 ?>