<?php
/** External authentication via LDAP for FusionForge
* Copyright 2003, Roland Mas <lolando@debian.org>
- * Copyright 2004, Roland Mas <roland@gnurandal.com>
+ * Copyright 2004, Roland Mas <roland@gnurandal.com>
* The Gforge Group, LLC <http://gforgegroup.com/>
* Copyright 2004, Christian Bayle <bayle@debian.org>
* Copyright 2009-2010, Alain Peyrat, Alcatel-Lucent
* Copyright 2009, Chris Dalzell, OpenGameForge.org
* Copyright 2011, Roland Mas
*
- * This file is part of FusionForge
- *
- * This plugin, like FusionForge, is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
*
* FusionForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once $GLOBALS['gfcommon'].'include/User.class.php';
$this->declareConfigVars();
}
-
+
function syncAccountInfo($params) {
if (!$this->syncDataOn($params['event'])) {
return true;
$u = new GFUser();
$user_data = array();
-
+
$user_data['unix_name'] = $n;
$user_data['firstname'] = '';
$user_data['lastname'] = '';
$send_mail)) {
return false;
}
-
+
if (!$u->setStatus ('A')) {
return false;
}
&& !session_check_credentials_in_database($this->saved_login, $this->saved_password, false)) {
$u->setPasswd($this->saved_password);
}
-
+
$mapped_data = array(
'username' => $u->getUnixName(),
'md5_password' => '',
'email' => $u->getEmail(),
'phone' => $u->getPhone()
);
-
+
foreach (explode(',', forge_get_config('mapping', $this->name))
as $map_entry) {
list ($fffield, $ldapfield) = explode('=',$map_entry);
$mapped_data[$fffield] = $data[$ldapfield][0];
}
}
-
+
$u->update($mapped_data['firstname'],
$mapped_data['lastname'],
$u->getLanguage(),
}
if (forge_get_config('manager_dn', $this->name)) {
- ldap_bind($this->ldap_conn,
+ ldap_bind($this->ldap_conn,
forge_get_config('manager_dn', $this->name),
forge_get_config('ldap_password'));
} else {
}
}
- $data = fetchDataForUser($loginname);
+ $data = $this->fetchDataForUser($loginname);
if (!$data) {
return FORGE_AUTH_AUTHORITATIVE_REJECT;
}
}
}
+function debuglog($msg) {
+ $fp = fopen("/tmp/ldap.log", "a+");
+ fwrite ($fp, $msg."\n");
+ fclose($fp);
+}
+
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
-
-?>