Ignore:
Timestamp:
09/13/10 21:45:17 (9 years ago)
Author:
Eric
Message:

Merge from Trunk to Branch 2.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Register_FluxBB/branches/2.3/admin/admin.php

    r6815 r6899  
    77if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 
    88 
    9 //ini_set('error_reporting', E_ALL); 
    10 //ini_set('display_errors', true); 
     9ini_set('error_reporting', E_ALL); 
     10ini_set('display_errors', true); 
    1111 
    1212include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 
     
    574574  if (isset($_POST['submit']) and !is_adviser() and isset($_POST['FluxBB_prefix']) and isset($_POST['FluxBB_admin']) and isset($_POST['FluxBB_guest']) and isset($_POST['FluxBB_del_pt']) and isset($_POST['FluxBB_confirm']) and isset($_POST['FluxBB_details'])) 
    575575  { 
    576     $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';'.$_POST['FluxBB_UAM'].';'.$_POST['FluxBB_group']; 
    577  
    578     $query = ' 
     576 
     577/* Configuration controls */ 
     578// Piwigo's admin username control 
     579    $query1 = " 
     580SELECT username, id 
     581FROM ".USERS_TABLE." 
     582WHERE id = ".$conf['webmaster_id']." 
     583;"; 
     584 
     585    $pwgadmin = pwg_db_fetch_assoc(pwg_query($query1)); 
     586 
     587// FluxBB's admin username control 
     588    $query2 = " 
     589SELECT username, id 
     590FROM ".FluxBB_USERS_TABLE." 
     591WHERE id = 2 
     592;"; 
     593 
     594    $fbbadmin = pwg_db_fetch_assoc(pwg_query($query2)); 
     595 
     596// FluxBB's Guest username control 
     597    $query3 = " 
     598SELECT username, id 
     599FROM ".FluxBB_USERS_TABLE." 
     600WHERE id = 1 
     601;"; 
     602 
     603    $fbbguest = pwg_db_fetch_assoc(pwg_query($query3)); 
     604 
     605// Compute configuration errors 
     606    if (stripslashes($pwgadmin['username']) != stripslashes($_POST['FluxBB_admin'])) 
     607    { 
     608      array_push($page['errors'], l10n('error_config_admin1')); 
     609    } 
     610    if (stripslashes($pwgadmin['username']) != stripslashes($fbbadmin['username'])) 
     611    { 
     612      array_push($page['errors'], l10n('error_config_admin2')); 
     613    } 
     614    if (stripslashes($fbbguest['username']) != stripslashes($_POST['FluxBB_guest'])) 
     615    { 
     616      array_push($page['errors'], l10n('error_config_guest')); 
     617    } 
     618    elseif (count($page['errors']) == 0) 
     619    { 
     620      if (!function_exists('FindAvailableConfirmMailID')) 
     621      { 
     622      $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';false;0'; 
     623      } 
     624      elseif (function_exists('FindAvailableConfirmMailID')) 
     625      { 
     626        $conf_UAM = unserialize($conf['UserAdvManager']); 
     627         
     628        if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and isset($conf_UAM[2]) and $conf_UAM[2] != '-1') 
     629        { 
     630          $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';'.$_POST['FluxBB_UAM'].';'.$_POST['FluxBB_group']; 
     631        } 
     632        else 
     633        { 
     634          $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';false;0'; 
     635        } 
     636      } 
     637 
     638      $query = ' 
    579639UPDATE '.CONFIG_TABLE.' 
    580640SET value="'.$conf['Register_FluxBB'].'" 
     
    583643;'; 
    584644 
    585     pwg_query($query); 
    586  
    587     array_push($page['infos'], l10n('save_config')); 
     645      pwg_query($query); 
     646       
     647      array_push($page['infos'], l10n('save_config')); 
     648    } 
    588649  } 
    589650 
     
    617678      $UAM_bridge = true; 
    618679    } 
    619   } 
    620    
    621   $template->assign( 
    622     array 
    623     ( 
    624       'UAM_BRIDGE'            => $UAM_bridge, 
    625       'FluxBB_UAM_LINK_TRUE'  => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') ? 'checked="checked"' : '', 
    626       'FluxBB_UAM_LINK_FALSE' => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'false') ? 'checked="checked"' : '', 
    627       'FluxBB_GROUP'          => $conf_Register_FluxBB[7], 
    628     ) 
    629   ); 
    630  
     680   
     681    $template->assign( 
     682      array 
     683      ( 
     684        'UAM_BRIDGE'            => $UAM_bridge, 
     685        'FluxBB_UAM_LINK_TRUE'  => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') ? 'checked="checked"' : '', 
     686        'FluxBB_UAM_LINK_FALSE' => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'false') ? 'checked="checked"' : '', 
     687        'FluxBB_GROUP'          => $conf_Register_FluxBB[7], 
     688      ) 
     689    ); 
     690  } 
     691     
    631692  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl'); 
    632693  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
     
    635696 
    636697        case 'Migration': 
     698   
     699  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 
    637700         
    638701  if ( isset($_POST['Migration']) and !is_adviser() ) 
     
    654717 
    655718    $result = pwg_query($query); 
    656    
     719        
    657720    while ($row = pwg_db_fetch_assoc($result)) 
    658721    { 
Note: See TracChangeset for help on using the changeset viewer.