do i need to change the ones in pear/LiveUser/Auth/Ldap.php this one as well?You don't need to change default settings in Ldap.php.
require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/users_common.php"); $fieldValues = array(....) // define all necessary fields from ldap $editUser = new User(); if ($editUser->create($fieldValues)) { if ($uType == 'Staff') { $editUser->setUserType($Type); } }
function readUserData($handle = '', $passwd = '', $auth_user_id = false) { if (!$auth_user_id) { $result = false; $connect = @ldap_connect('ldap://' . $this->ldap_host, $this->ldap_port); if ($connect) { ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, $this->ldap_protocol_ver); if ($this->ldap_tls) { @ldap_start_tls($connect); } // Perform search for user... $base = "o=blah"; $filter = "cn=$handle"; $attributes = array("dn","givenname","sn","mail" ); $results = ldap_search($connect, $base, $filter, $attributes); // Retrieve results... $entry = ldap_get_entries($connect, $results); $dn = $entry[0]['dn']; $fname = $entry[0]['givenname'][0]; $lname = $entry[0]['sn'][0]; $email = $entry[0]['mail'][0]; $bind = sprintf($dn, $handle); if (@ldap_bind($connect, $bind, $passwd)) { $result = true; $fullname = "$fname $lname"; $password="michigan"; require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/users_common.php"); $fieldValues = array("$handle","$password","$fullname","$email"); // define all necessary fields from ldap $editUser = new User(); $phorumUser = new Phorum_user(); if (!$phorumUser->UserNameExists($fieldValues['UName']) && $editUser->create($fieldValues)) { if ($uType == 'Staff') { $editUser->setUserType($Type); } $phorumUser->create($fieldValues['UName'], $password, $fieldValues['EMail'], $editUser->getUserId()); ldap_close($connect);
change to
require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/users_common.php");
global $ADMIN_DIR; require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/users_common.php"); $editUser = new User(); $phorumUser = new Phorum_user(); $phorumUser->create($fieldValues['UName']=$handle, $password, $fieldValues['EMail']=$email, $editUser->getUserId());
$entry = ldap_get_entries($connect, $results); $dn = $entry[0]['dn']; $fname = $entry[0]['givenname'][0]; $lname = $entry[0]['sn'][0]; $email = $entry[0]['mail'][0]; $fullname = "$fname $lname"; $password="michigan"; $bind = sprintf($dn, $handle); if (@ldap_bind($connect, $bind, $passwd)) { $result = true; } ldap_close($connect); global $ADMIN_DIR; require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/users_common.php"); $fieldValues = array($fullname,$handle,$password,$email); // define all necessary fields from ldap $editUser = new User(); $phorumUser = new Phorum_user(); $phorumUser->create($fieldValues['UName']=$handle, $password,$fieldValues['EMail']=$email,$editUser->getUserId()); $editUser->create($fieldValues['UName']=$handle, $fieldValues['Name']=$fullname,$password, $fieldValues['EMail']=$email,$fieldValues['Type']='Subscribers');
global $ADMIN_DIR; require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/users_common.php"); $fieldValues = array('UName'=>$handle, 'Name'=>$fullname, 'EMail'=>$email, 'Type'=>'Subscribers'); $editUser = new User(); $phorumUser = new Phorum_user(); if (!$phorumUser->UserNameExists($fieldValues['UName']) && $editUser->create($fieldValues)) { echo "blah"; $phorumUser->create($fieldValues['UName']=$handle, $password,$fieldValues['EMail']=$email,$editUser->getUserId()); } else { echo "blahhhhhhhhhhhhhhhhhhhhh"; } }
if (!$phorumUser->UserNameExists($fieldValues['UName']) && $editUser->create($fieldValues))
global $ADMIN_DIR; require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/users_common.php"); $fieldValues = array('UName'=>$handle, 'Name'=>$fullname, 'EMail'=>$email, 'Type'=>'Subscribers'); $fieldValues['passwd'] = $password; $editUser = new User(); $phorumUser = new Phorum_user(); if (!$phorumUser->UserNameExists($fieldValues['UName']) && $editUser->create($fieldValues)) { echo "blah"; $phorumUser->create($fieldValues['UName']=$handle, $password,$fieldValues['EMail']=$email,$editUser->getUserId()); } else { echo "blahhhhhhhhhhhhhhhhhhhhh"; } }
$entry = ldap_get_entries($connect, $results); $dn = $entry[0]['dn']; $fname = $entry[0]['givenname'][0]; $lname = $entry[0]['sn'][0]; $email = $entry[0]['mail'][0]; $fullname = "$fname $lname"; $password="michigan";
$editUser = new User(); $fields['UName'] = 'test'; $fields['Name'] = 'Test'; $fields['EMail'] = 'test@test'; $fields['Reader'] = 'Y'; $fields['passwd'] = '1234567890'; if ($editUser->create($fields)) { $editUser->setUserType('Subscriber'); echo 'OK'; }
I just
Can I buy you pizza or something?
It looks like you're new here. If you want to get involved, click one of these buttons!