function getMD5Passwd() {
return $this->data_array['user_pw'];
}
+
+ //Added to be compatible with codendi getUserPw function
+ function getUserPw() {
+ return $this->data_array['user_pw'];
+ }
/**
* getConfirmHash - the confirm hash in the db.
function getEmail() {
return $this->data_array['email'];
}
+
+ /**
+ * getSha1Email - a SHA1 encoded hash of the email URI (including mailto: prefix)
+ *
+ * @return string The SHA1 encoded value for the email
+ */
+ function getSha1Email() {
+ return sha1('mailto:'.$this->getEmail());
+ }
/**
* getNewEmail - while changing an email address, it is stored here until confirmation.
* @return string This user's real name.
*/
function getRealName() {
- return $this->getFirstName(). ' ' .$this->getLastName();
+ $last_name = $this->getLastName();
+ return $this->getFirstName(). ($last_name ? ' ' .$last_name:'');
}
/**
}
return $role;
}
+
+ function isMember($group_id, $type=0) {
+ if (!session_loggedin()) {
+ return false;
+ }
+
+ $project =& group_get_object($group_id);
+
+ if (!$project || !is_object($project)) {
+ exit_no_group();
+ }
+
+ $perm =& $project->getPermission( $this );
+ if (!$perm || !is_object($perm) || !$perm->isMember()) {
+ return false;
+ }
+
+ $type=strtoupper($type);
+
+ switch ($type) {
+ case 'P2' : {
+ //pm admin
+ return $perm->isPMAdmin();
+ break;
+ }
+ case 'F2' : {
+ //forum admin
+ return $perm->isForumAdmin();
+ break;
+ }
+ case '0' : {
+ //just in this group
+ return $perm->isMember();
+ break;
+ }
+ case 'A' : {
+ //admin for this group
+ return $perm->isAdmin();
+ break;
+ }
+ case 'D1' : {
+ //document editor
+ return $perm->isDocEditor();
+ break;
+ }
+ default : {
+ //fubar request
+ return false;
+ }
+ }
+ return false;
+
+ }
}
/*