Indefero

Indefero Commit Details


Date:2009-05-26 06:33:00 (15 years 6 months ago)
Author:Loic d'Anterroches
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:c866d09e27e54d1d034010043e0c9b12d40e9b8e
Parents: 668b49df40c233deb9b9410aa8546b0701e1f6de
Message:Fixed issue 219, notification when adding a wrong user in a project.

Changes:

File differences

src/IDF/Form/Admin/ProjectCreate.php
133133
134134
135135
136
137
138
139
140
141
142
143
144
145
136146
137147
138148
'IDF_Form_Admin_ProjectCreate', $params);
}
public function clean_owners()
{
return IDF_Form_MembersConf::checkBadLogins($this->cleaned_data['owners']);
}
public function clean_members()
{
return IDF_Form_MembersConf::checkBadLogins($this->cleaned_data['members']);
}
public function clean_svn_remote_url()
{
$this->cleaned_data['svn_remote_url'] = (!empty($this->cleaned_data['svn_remote_url'])) ? $this->cleaned_data['svn_remote_url'] : '';
src/IDF/Form/Admin/ProjectUpdate.php
6161
6262
6363
64
65
66
67
68
69
70
71
72
73
6474
6575
6676
));
}
public function clean_owners()
{
return IDF_Form_MembersConf::checkBadLogins($this->cleaned_data['owners']);
}
public function clean_members()
{
return IDF_Form_MembersConf::checkBadLogins($this->cleaned_data['members']);
}
public function save($commit=true)
{
if (!$this->isValid()) {
src/IDF/Form/MembersConf.php
6767
6868
6969
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
70110
71111
72112
$this->project->membershipsUpdated();
}
public function clean_owners()
{
return self::checkBadLogins($this->cleaned_data['owners']);
}
public function clean_members()
{
return self::checkBadLogins($this->cleaned_data['members']);
}
/**
* From the input, find the bad logins.
*
* Throw a Pluf_Form_Invalid exception when bad logins are found.
*
* @param string Comma, new line delimited list of logins
* @return string Comma, new line delimited list of logins
*/
public static function checkBadLogins($logins)
{
$bad = array();
foreach (preg_split("/\015\012|\015|\012|\,/", $logins, -1, PREG_SPLIT_NO_EMPTY) as $login) {
$sql = new Pluf_SQL('login=%s', array(trim($login)));
try {
$user = Pluf::factory('Pluf_User')->getOne(array('filter'=>$sql->gen()));
if (null == $user) {
$bad[] = $login;
}
} catch (Exception $e) {
$bad[] = $login;
}
}
$n = count($bad);
if ($n) {
$badlogins = Pluf_esc(implode(', ', $bad));
throw new Pluf_Form_Invalid(sprintf(_n('The following login is invalid: %s.', 'The following login are invalids: %s.', $n), $badlogins));
}
return $logins;
}
/**
* The update of the memberships is done in different places. This
* avoids duplicating code.
src/IDF/Form/TabsConf.php
8686
8787
8888
89
90
91
92
93
8994
9095
9196
));
}
public function clean_authorized_users()
{
return IDF_Form_MembersConf::checkBadLogins($this->cleaned_data['authorized_users']);
}
public function save($commit=true)
{
if (!$this->isValid()) {

Archive Download the corresponding diff file

Page rendered in 0.10003s using 14 queries.