Changeset 22204 for extensions/Register_FluxBB/include
- Timestamp:
- Apr 14, 2013, 4:11:39 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Register_FluxBB/include/functions.inc.php
r22092 r22204 3 3 include_once (PHPWG_ROOT_PATH.'/include/constants.php'); 4 4 include_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 }16 5 17 6 … … 65 54 66 55 /** 67 * Checks special users exclusion bef aore add new registered user in FluxBB user table56 * Checks special users exclusion before add new registered user in FluxBB user table 68 57 */ 69 58 function Register_FluxBB_Adduser($register_user) 70 59 { 71 60 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*/) 75 64 { 76 65 FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']); 77 66 } 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 }*/ 78 72 } 79 73 … … 643 637 * To solve password synch problem, passwords are reset to NULL to force users to get a new password on their profile page 644 638 * 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 */ 643 function Synch_Piwigo_Adduser($fluxbb_id, $username, $password, $email) 648 644 { 649 645 global $conf; 650 646 load_language('plugin.lang', REGFLUXBB_PATH); 651 647 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)) 660 651 { 661 652 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 662 653 663 654 $keyargs_content = array( 664 get_l10n_args('Hello %s,', $ login),655 get_l10n_args('Hello %s,', $username), 665 656 get_l10n_args('To synchronize your forum access with the gallery you have been registered at %s!', $conf['gallery_title']), 666 657 get_l10n_args('', ''), 667 658 get_l10n_args('Here are your connection settings', ''), 668 get_l10n_args('Username: %s', $ login),659 get_l10n_args('Username: %s', $username), 669 660 get_l10n_args('Password: %s', $password), 670 get_l10n_args('Email: %s', $ mail_address),661 get_l10n_args('Email: %s', $email), 671 662 get_l10n_args('', ''), 672 663 get_l10n_args('Please change your password at your first connexion on the gallery', ''), … … 676 667 677 668 pwg_mail( 678 $ mail_address,669 $email, 679 670 array( 680 671 'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'), … … 687 678 688 679 FluxBB_Linkuser($pwg_id, $fluxbb_id, "NOK"); 689 690 $error = false;691 680 } 692 } 693 else $error = true; 694 695 return $error; 681 682 return $errors; 696 683 } 697 684
Note: See TracChangeset
for help on using the changeset viewer.