Ignore:
Timestamp:
Apr 14, 2013, 4:11:39 PM (11 years ago)
Author:
Eric
Message:

Version 2.5.9:
Bug fixed : Adding accounts from FluxBB to Piwigo was not working
Rewrite plugin admin panel URL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Register_FluxBB/include/functions.inc.php

    r22092 r22204  
    33include_once (PHPWG_ROOT_PATH.'/include/constants.php');
    44include_once (REGFLUXBB_PATH.'include/constants.php');
    5 
    6 
    7 function Register_FluxBB_admin_menu($menu)
    8 {
    9   array_push($menu, array(
    10     'NAME' => 'Register FluxBB',
    11     'URL' => get_root_url().'admin.php?page=plugin-'.basename(REGFLUXBB_PATH)
    12     )
    13   );
    14   return $menu;
    15 }
    165
    176
     
    6554
    6655/**
    67  * Checks special users exclusion befaore add new registered user in FluxBB user table
     56 * Checks special users exclusion before add new registered user in FluxBB user table
    6857 */
    6958function Register_FluxBB_Adduser($register_user)
    7059{
    7160  global $errors, $conf;
    72        
    73   // Exclusion of Adult_Content users
    74   if ($register_user['username'] != "16" and $register_user['username'] != "18")
     61
     62  // Exclusion of Adult_Content users - //Todo: Compatibility with user_mass_register plugin
     63  if ($register_user['username'] != "16" and $register_user['username'] != "18" /*and strpos(@$_GET['page'],'user_mass_register') === false*/)
    7564  {
    7665    FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
    7766  }
     67  /*elseif ($register_user['username'] != "16" and $register_user['username'] != "18" and strpos(@$_GET['page'],'user_mass_register') !== false)
     68  {
     69    //include_once(PHPWG_ROOT_PATH.'plugins/user_mass_register/admin.php');
     70    //FluxBB_Adduser($register_user['id'],$login, $password, $email);
     71  }*/
    7872}
    7973
     
    643637 * To solve password synch problem, passwords are reset to NULL to force users to get a new password on their profile page
    644638 *
    645  * @return : $error
    646  */
    647 function Synch_Piwigo_Adduser($fluxbb_id, $username, $email)
     639 * Based on user_mass_register plugin (thx to plg!)
     640 *
     641 * @return : $errors
     642 */
     643function Synch_Piwigo_Adduser($fluxbb_id, $username, $password, $email)
    648644{
    649645  global $conf;
    650646  load_language('plugin.lang', REGFLUXBB_PATH);
    651647
    652   if (!get_userid_by_email($email) and !get_userid($username))
    653   {
    654     // find a password
    655     $password = generate_key(8);
    656 
    657     $error = register_user($username, $password, $email, false);
    658 
    659     if (empty($error))
     648    $errors = register_user($username, $password, $email, false);
     649
     650    if (empty($errors))
    660651    {
    661652      include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
    662653
    663654      $keyargs_content = array(
    664         get_l10n_args('Hello %s,', $login),
     655        get_l10n_args('Hello %s,', $username),
    665656        get_l10n_args('To synchronize your forum access with the gallery you have been registered at %s!', $conf['gallery_title']),
    666657        get_l10n_args('', ''),
    667658        get_l10n_args('Here are your connection settings', ''),
    668         get_l10n_args('Username: %s', $login),
     659        get_l10n_args('Username: %s', $username),
    669660        get_l10n_args('Password: %s', $password),
    670         get_l10n_args('Email: %s', $mail_address),
     661        get_l10n_args('Email: %s', $email),
    671662        get_l10n_args('', ''),
    672663        get_l10n_args('Please change your password at your first connexion on the gallery', ''),
     
    676667
    677668      pwg_mail(
    678         $mail_address,
     669        $email,
    679670        array(
    680671          'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'),
     
    687678
    688679      FluxBB_Linkuser($pwg_id, $fluxbb_id, "NOK");
    689      
    690       $error = false;
    691680    }
    692   }
    693   else $error = true;
    694 
    695   return $error;
     681
     682  return $errors;
    696683}
    697684
Note: See TracChangeset for help on using the changeset viewer.