getPath( 'admin_html' ) );
/** @global string $_CB_adminpath
* @global array $ueConfig
*/
global $_CB_adminpath, $ueConfig;
if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
$_CB_adminpath = JPATH_ADMINISTRATOR . '/components/com_comprofiler';
} else {
$_CB_adminpath = $mainframe->getCfg( 'absolute_path' ). '/administrator/components/com_comprofiler';
include_once( $_CB_adminpath . '/plugin.foundation.php' );
}
$_CB_framework->cbset( '_ui', 2 ); // : we're in 1: frontend, 2: admin back-end
if($_CB_framework->getCfg( 'debug' )) {
ini_set( 'display_errors', true );
error_reporting( E_ALL );
}
cbimport( 'language.front' );
cbimport( 'cb.tabs' );
cbimport( 'cb.imgtoolbox' );
if ( class_exists( 'JFactory' ) ) { // Joomla 1.5 : for string WARNREG_EMAIL_INUSE used in error js popup.
$lang =& JFactory::getLanguage();
$lang->load( "com_users" );
}
// backend only:
cbimport( 'cb.adminfilesystem' );
cbimport( 'cb.installer' );
cbimport( 'cb.params' );
cbimport( 'cb.pagination' );
if ( ! $_CB_framework->check_acl( 'canManageUsers', $_CB_framework->myUserType() ) ) {
cbRedirect( 'index2.php', _UE_NOT_AUTHORIZED, 'error' );
}
/** Backend menu: 'show' : only displays close button, 'edit' : special close button
* @global stdClass $_CB_Backend_Menu */
global $_CB_Backend_Menu;
$_CB_Backend_Menu = new stdClass();
$option = $_CB_framework->getRequestVar( 'option' );
$task = $_CB_framework->getRequestVar( 'task' );
global $_CB_Backend_Title, $_CB_Backend_task;
$_CB_Backend_Title = array();
$_CB_Backend_task = $task;
//$task = trim( cbGetParam( $_REQUEST, 'task', null ) );
$cid = cbGetParam( $_REQUEST, 'cid', array( 0 ) );
$uid = cbGetParam( $_REQUEST, 'uid', array( 0 ) );
if ( ! is_array( $cid )) {
$cid = array ( (int) $cid );
}
$oldignoreuserabort = ignore_user_abort( true );
$taskPart1 = strtok( $task, '.' );
$_CB_framework->document->_outputToHeadCollectionStart();
ob_start();
// remind step 2 if forgotten/failed:
$tgzFile = $_CB_framework->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/pluginsfiles.tgz';
if ( file_exists( $tgzFile ) ) {
if ( in_array( $taskPart1, array( 'showusers', 'showconfig', 'showTab', 'showField', 'showLists', 'tools', 'showPlugins', '' ) ) ) {
echo '
Warning: file ' . $tgzFile . ' still exists. This is probably due to the fact that first installation step did not complete, or second installation step did not take place. If you are sure that first step has been performed, you need to execute second installation step before using CB. You can do this now by clicking here: '
. '
please click here to continue next and last installation step.
';
}
}
switch ( $taskPart1 ) {
case "new":
editUser( 0, $option );
break;
case "edit":
editUser( intval( $cid[0] ), $option );
break;
case "save":
cbSpoofCheck( 'user' );
saveUser( $option );
break;
case "remove":
cbSpoofCheck( 'user' );
removeUsers( $cid, $option );
break;
case "block":
cbSpoofCheck( 'user' );
changeUserBlock( $cid, 1, $option );
break;
case "unblock":
cbSpoofCheck( 'user' );
changeUserBlock( $cid, 0, $option );
break;
case "approve":
cbSpoofCheck( 'user' );
approveUser( $cid, 1, $option );
break;
case "reject":
cbSpoofCheck( 'user' );
approveUser( $cid, 0, $option );
break;
case "showconfig":
showConfig( $option );
break;
case "showinstruction":
global $_CB_database;
showInstructions( $_CB_database, $option, $_CB_framework->getCfg( 'lang' ) );
break;
case "saveconfig":
cbSpoofCheck( 'config' );
saveConfig( $option );
break;
case "newTab":
editTab( 0, $option);
break;
case "editTab":
editTab( intval( $cid[0] ), $option, $task );
break;
case "saveTab":
cbSpoofCheck( 'tab' );
saveTab( $option );
break;
case "removeTab":
cbSpoofCheck( 'tab' );
removeTabs( $cid, $option );
break;
case "showTab":
showTab( $option );
break;
case "orderupTab":
case "orderdownTab":
cbSpoofCheck( 'tab' );
orderTabs( $cid[0], ($task == 'orderupTab' ? -1 : 1), $option);
break;
case "newField":
editField( 0, $option, $task );
break;
case "editField":
editField( intval( $cid[0] ), $option, $task );
break;
case "reloadField":
cbSpoofCheck( 'field' );
editField( (int) cbGetParam( $_POST, 'fieldid', 0 ), $option, $task );
break;
case "saveField":
case "applyField":
cbSpoofCheck( 'field' );
saveField( $option, $task );
break;
case "removeField":
cbSpoofCheck( 'field' );
removeField( $cid, $option );
break;
case "showField":
showField( $option );
break;
case "orderupField":
cbSpoofCheck( 'field' );
orderFields( $cid[0], -1, $option );
break;
case "orderdownField":
cbSpoofCheck( 'field' );
orderFields( $cid[0], 1, $option );
break;
case "saveList":
cbSpoofCheck( 'list' );
saveList($option );
break;
case "editList":
editList( $cid[0], 1, $option );
break;
case "newList":
editList( 0, $option);
break;
case "showLists":
showLists( $option );
break;
case "removeList":
cbSpoofCheck( 'list' );
removeList( $cid, $option );
break;
case "orderupList":
cbSpoofCheck( 'list' );
orderLists( $cid[0], -1, $option );
break;
case "orderdownList":
cbSpoofCheck( 'list' );
orderLists( $cid[0], 1, $option );
break;
case "fieldPublishedYes":
cbSpoofCheck( 'field' );
publishField( $cid, 1, $option );
break;
case "fieldPublishedNo":
cbSpoofCheck( 'field' );
publishField( $cid, 0, $option );
break;
case "fieldRequiredYes":
cbSpoofCheck( 'field' );
requiredField( $cid, 1, $option );
break;
case "fieldRequiredNo":
cbSpoofCheck( 'field' );
requiredField( $cid, 0, $option );
break;
case "fieldProfileYes1":
cbSpoofCheck( 'field' );
profileField( $cid, 1, $option );
break;
case "fieldProfileYes2":
cbSpoofCheck( 'field' );
profileField( $cid, 2, $option );
break;
case "fieldProfileNo":
cbSpoofCheck( 'field' );
profileField( $cid, 0, $option );
break;
case "fieldRegistrationYes":
cbSpoofCheck( 'field' );
registrationField( $cid, 1, $option );
break;
case "fieldRegistrationNo":
cbSpoofCheck( 'field' );
registrationField( $cid, 0, $option );
break;
case "fieldSearchableYes":
cbSpoofCheck( 'field' );
searchableField( $cid, 1, $option );
break;
case "fieldSearchableNo":
cbSpoofCheck( 'field' );
searchableField( $cid, 0, $option );
break;
case "listPublishedYes":
cbSpoofCheck( 'list' );
listPublishedField( $cid, 1, $option );
break;
case "listPublishedNo":
cbSpoofCheck( 'list' );
listPublishedField( $cid, 0, $option );
break;
case "listDefaultYes":
cbSpoofCheck( 'list' );
listDefaultField( $cid, 1, $option );
break;
case "listDefaultNo":
cbSpoofCheck( 'list' );
listDefaultField( $cid, 0, $option );
break;
case "tabPublishedYes":
cbSpoofCheck( 'tab' );
tabPublishedField( $cid, 1, $option );
break;
case "tabPublishedNo":
cbSpoofCheck( 'tab' );
tabPublishedField( $cid, 0, $option );
break;
case "tools":
loadTools();
break;
case "loadSampleData":
cbSpoofCheck( 'cbtools', 'GET' );
loadSampleData();
break;
case "syncUsers":
cbSpoofCheck( 'cbtools', 'GET' );
syncUsers();
break;
case "checkcbdb":
cbSpoofCheck( 'cbtools', 'GET' );
checkcbdb( (int) cbGetParam( $_GET, 'databaseid', 0 ) );
break;
case "fixcbdb":
cbSpoofCheck( 'cbtools', 'GET' );
fixcbdb( (int) cbGetParam( $_GET, 'dryrun', 1 ), (int) cbGetParam( $_GET, 'databaseid', 0 ) );
break;
case "fixacldb":
cbSpoofCheck( 'cbtools', 'GET' );
fixacldb();
break;
case "fixcbmiscdb":
cbSpoofCheck( 'cbtools', 'GET' );
fixcbmiscdb();
break;
case "showusers":
showUsers( $option );
break;
case 'savetaborder':
cbSpoofCheck( 'tab' );
saveTabOrder( $cid );
break;
case 'savefieldorder':
cbSpoofCheck( 'field' );
saveFieldOrder( $cid );
break;
case 'savelistorder':
cbSpoofCheck( 'list' );
saveListOrder( $cid );
break;
case 'newPlugin':
case 'editPlugin':
editPlugin( $option, $task, $cid[0] );
break;
case 'savePlugin':
case 'applyPlugin':
cbSpoofCheck( 'plugin' );
savePlugin( $option, $task );
break;
case 'deletePlugin':
cbSpoofCheck( 'plugin' );
removePlugin( $cid, $option );
break;
case 'cancelPlugin':
cancelPlugin( $option );
break;
case 'cancelPluginAction':
cancelPluginAction( $option );
break;
case 'publishPlugin':
case 'unpublishPlugin':
cbSpoofCheck( 'plugin' );
publishPlugin( $cid, ($task == 'publishPlugin'), $option );
break;
case 'orderupPlugin':
case 'orderdownPlugin':
cbSpoofCheck( 'plugin' );
orderPlugin( $cid[0], ($task == 'orderupPlugin' ? -1 : 1), $option);
break;
case 'accesspublic':
case 'accessregistered':
case 'accessspecial':
cbSpoofCheck( 'plugin' );
accessMenu( $cid[0], $task, $option );
break;
case 'savepluginorder':
cbSpoofCheck( 'plugin' );
savePluginOrder( $cid );
break;
case 'showPlugins':
viewPlugins( $option);
break;
case 'installPluginUpload':
cbSpoofCheck( 'plugin' );
installPluginUpload();
break;
case 'installPluginDir':
cbSpoofCheck( 'plugin' );
installPluginDir();
break;
case 'installPluginURL':
cbSpoofCheck( 'plugin' );
installPluginURL();
break;
case 'pluginmenu':
pluginMenu( $option, cbGetParam( $_REQUEST, 'pluginid', 0 ) );
break;
case 'latestVersion':
latestVersion();
break;
case "fieldclass":
case "tabclass":
case "pluginclass":
tabClass( $option, $task, cbGetParam( $_REQUEST, 'user', 0 ) );
break;
case "finishinstallation":
finishInstallation( $option );
break;
default:
// var_export( $ _POST ); //DEBUG!
teamCredits(2);
break;
}
echo $_CB_framework->getAllJsPageCodes();
$html = ob_get_contents();
ob_end_clean();
if ( in_array( $taskPart1, array( 'fieldclass', 'tabclass', 'pluginclass' ) ) || ( cbGetParam( $_GET, 'no_html', 0 ) == 1 ) ) {
echo $html;
} else {
$cssIE7fix = '-->