* @return bool
*/
function can_change_password() {
- return false;
+ return !empty($this->config->changepasswordurl);
}
/**
}
/**
- * Returns the URL for changing the user's pw, or false if the default can
+ * Returns the URL for changing the user's pw, or empty if the default can
* be used.
*
- * @return bool
+ * @return string
*/
function change_password_url() {
return $this->config->changepasswordurl;
* @return bool
*/
function can_change_password() {
- return ($this->config->passtype === 'internal');
+ return ($this->config->passtype == 'internal' or !empty($this->config->changepasswordurl));
}
/**
- * Returns the URL for changing the user's pw, or false if the default can
+ * Returns the URL for changing the user's pw, or empty if the default can
* be used.
*
- * @return bool
+ * @return string
*/
function change_password_url() {
- return $this->config->changepasswordurl;
+ if ($this->config->passtype == 'internal') {
+ // standard form
+ return '';
+ } else {
+ // use custom url
+ return $this->config->changepasswordurl;
+ }
}
/**
return update_internal_user_password($user, $newpassword);
}
- /*
+ /**
* Sign up a new user ready for confirmation.
*/
function user_signup($user, $notify = true) {
}
}
- /*
+ /**
* Confirm the new user as registered.
*/
function user_confirm($username, $confirmsecret) {
}
/**
- * Returns the URL for changing the user's pw, or false if the default can
+ * Returns the URL for changing the user's pw, or empty if the default can
* be used.
*
- * @return bool
+ * @return mixed
*/
function change_password_url() {
- return false;
+ return ''; // use dafult internal method
+ }
+
+ /**
+ * Returns true if plugin allows resetting of internal password.
+ *
+ * @return bool
+ */
+ function can_reset_password() {
+ return true;
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.
*
- * @param string $username The username
- * @param string $password The password
+ * @param string $username The username (with system magic quotes)
+ * @param string $password The password (with system magic quotes)
* @return bool Authentication success or failure.
*/
function user_login ($username, $password) {
}
error_reporting(0);
- $connection = imap_open($host, $username, $password, OP_HALFOPEN);
+ $connection = imap_open($host, stripslashes($username), stripslashes($password), OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
* @return bool
*/
function can_change_password() {
- return false;
+ return !empty($this->config->changepasswordurl);
}
/**
- * Returns the URL for changing the user's pw, or false if the default can
+ * Returns the URL for changing the user's pw, or empty if the default can
* be used.
*
- * @return bool
+ * @return string
*/
function change_password_url() {
- return $CFG->changepasswordurl; // TODO: will this be global?
- //return $this->config->changepasswordurl;
+ return $this->config->changepasswordurl;
}
/**
}
}
//hack prefix to objectclass
- if ('objectClass=' != substr($this->config->objectclass, 0, 12)) {
- $this->config->objectclass = 'objectClass='.$this->config->objectclass;
+ if (empty($this->config->objectclass)) { // Can't send empty filter
+ $this->config->objectclass='objectClass=*';
+ } else if (strpos($this->config->objectclass, 'objectClass=') !== 0) {
+ $this->config->objectclass = 'objectClass='.$this->config->objectclass;
}
+
}
/**
$user_dn = $this->ldap_find_userdn($ldapconnection, $extusername);
- if (empty($this->config->objectclass)) { // Can't send empty filter
- $this->config->objectclass="objectClass=*";
- }
-
if (!$user_info_result = ldap_read($ldapconnection, $user_dn, $this->config->objectclass, $search_attribs)) {
return false; // error!
}
//// get user's list from ldap to sql in a scalable fashion
////
// prepare some data we'll need
- if (! empty($this->config->objectclass)) {
- $this->config->objectclass="objectClass=*";
- }
-
$filter = "(&(".$this->config->user_attribute."=*)(".$this->config->objectclass."))";
$contexts = explode(";",$this->config->contexts);
* @return bool
*/
function can_change_password() {
- return true;
+ return !empty($this->config->stdchangepassword) or !empty($this->config->changepasswordurl);
}
/**
- * Returns the URL for changing the user's pw, or false if the default can
+ * Returns the URL for changing the user's pw, or empty if the default can
* be used.
*
* @return string url
if (empty($this->config->stdchangepassword)) {
return $this->config->changepasswordurl;
} else {
- return false;
+ return '';
}
}
}
/**
- * Returns the URL for changing the user's pw, or false if the default can
+ * Returns the URL for changing the user's pw, or empty if the default can
* be used.
*
- * @return bool
+ * @return string
*/
function change_password_url() {
- return false;
+ return '';
+ }
+
+ /**
+ * Returns true if plugin allows resetting of internal password.
+ *
+ * @return bool
+ */
+ function can_reset_password() {
+ return true;
}
/**
* @return bool
*/
function can_change_password() {
+ //TODO: it should be able to redirect, right?
return false;
}
* Returns the URL for changing the user's pw, or false if the default can
* be used.
*
- * @return bool
+ * @return string
*/
function change_password_url() {
- return false;
+ return '';
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.
*
- * @param string $username The username
- * @param string $password The password
+ * @param string $username The username (with system magic quotes)
+ * @param string $password The password (with system magic quotes)
* @return bool Authentication success or failure.
*/
function user_login ($username, $password) {
$host = '{' . trim($host) . ':' . $this->config->port . '/nntp}';
error_reporting(0);
- $connection = imap_open($host, $username, $password, OP_HALFOPEN);
+ $connection = imap_open($host, stripslashes($username), stripslashes($password), OP_HALFOPEN);
error_reporting($CFG->debug);
if ($connection) {
return false;
}
- /**
- * Returns the URL for changing the user's pw, or false if the default can
- * be used.
- *
- * @return bool
- */
- function change_password_url() {
- return false;
- }
-
/**
* Prints a form for configuring this authentication plugin.
*
}
/**
- * Returns the URL for changing the user's pw, or false if the default can
+ * Returns the URL for changing the user's pw, or empty if the default can
* be used.
*
- * @return bool
+ * @return string
*/
function change_password_url() {
- return false;
+ return '';
+ }
+
+ /**
+ * Returns true if plugin allows resetting of internal password.
+ *
+ * @return bool
+ */
+ function can_reset_password() {
+ return true;
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.
*
- * @param string $username The username
- * @param string $password The password
+ * @param string $username The username (with system magic quotes)
+ * @param string $password The password (with system magic quotes)
* @return bool Authentication success or failure.
*/
function user_login ($username, $password) {
// call_time_pass_reference of errormessage is deprecated - throws warnings in multiauth
//if (pam_auth($username, $password, &$errormessage)) {
- if (pam_auth($username, $password)) {
+ if (pam_auth(stripslashes($username), strislashes($password))) {
return true;
}
else {
* Returns true if the username and password work and false if they are
* wrong or don't exist.
*
- * @param string $username The username
- * @param string $password The password
+ * @param string $username The username (with system magic quotes)
+ * @param string $password The password (with system magic quotes)
* @return bool Authentication success or failure.
*/
function user_login($username, $password) {
}
error_reporting(0);
- $connection = imap_open($host, $username, $password);
+ $connection = imap_open($host, stripslashes($username), stripslashes($password));
error_reporting($CFG->debug);
if ($connection) {
* @return bool
*/
function can_change_password() {
- return false;
+ return !empty($this->config->changepasswordurl);
}
/**
* @return bool
*/
function change_password_url() {
- return $CFG->changepasswordurl; // TODO: will this be global?
- //return $this->config->changepasswordurl;
+ return $this->config->changepasswordurl;
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.
*
- * @param string $username The username
- * @param string $password The password
+ * @param string $username The username (with system magic quotes)
+ * @param string $password The password (with system magic quotes)
* @return bool Authentication success or failure.
*/
function user_login ($username, $password) {
// printf("nasport: $this->config->nasport <br/>");
// printf("secret: $this->config->secret <br/>");
- $rauth = new Auth_RADIUS_PAP($username, $password);
+ $rauth = new Auth_RADIUS_PAP(stripslashes($username), stripslashes($password));
$rauth->addServer($this->config->host, $this->config->nasport, $this->config->secret);
if (!$rauth->start()) {
* Returns true if the username and password work and false if they are
* wrong or don't exist.
*
- * @param string $username The username
- * @param string $password The password
+ * @param string $username The username (with system magic quotes)
+ * @param string $password The password (with system magic quotes)
* @return bool Authentication success or failure.
*/
function user_login($username, $password) {
$search_attribs = array();
foreach ($attrmap as $key=>$value) {
- if (!empty($CFG->unicodedb)) {
- $result[$key] = $this->get_first_string($_SERVER[$value]);
- } else {
- $result[$key] = $this->get_first_string(utf8_decode($_SERVER[$value]));
- }
+ $result[$key] = $this->get_first_string($_SERVER[$value]);
}
// Provide an API to modify the information to fit the Moodle internal