Indefero

Indefero Commit Details


Date:2011-02-20 16:57:48 (13 years 10 months ago)
Author:Patrick Georgi
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, release-1.1, release-1.2, release-1.3
Commit:5afd073ff30735b66b92f237ccdc9ea6d43ce63c
Parents: 46fda14e08e8936cb5f37bc53f79e3b375b84789
Message:If secondary mails exist, print them in account settings, and allow to delete them

Changes:

File differences

src/IDF/Views/User.php
127127
128128
129129
130
130131
131132
132133
133134
134135
135136
137
136138
137139
138140
......
158160
159161
160162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
161183
162184
163185
$form = new IDF_Form_UserAccount(null, $params);
}
$keys = $request->user->get_idf_key_list();
$mailaddrs = Pluf::factory('IDF_EmailAddress')->get_email_addresses_for_user($request->user);
return Pluf_Shortcuts_RenderToResponse('idf/user/myaccount.html',
array('page_title' => __('Your Account'),
'api_key' => $api_key,
'ext_pass' => $ext_pass,
'keys' => $keys,
'mailaddrs' => $mailaddrs,
'form' => $form),
$request);
}
}
/**
* Delete a mail address.
*
* This is redirecting to the preferences
*/
public $deleteMail_precond = array('Pluf_Precondition::loginRequired');
public function deleteMail($request, $match)
{
$url = Pluf_HTTP_URL_urlForView('IDF_Views_User::myAccount');
if ($request->method == 'POST') {
$address = Pluf_Shortcuts_GetObjectOr404('IDF_EmailAddress', $match[1]);
if ($address->user != $request->user->id) {
return new Pluf_HTTP_Response_Forbidden($request);
}
$address->delete();
$request->user->setMessage(__('The address has been deleted.'));
}
return new Pluf_HTTP_Response_Redirect($url);
}
/**
* Enter the key to change an email address.
*
* This is redirecting to changeEmailDo
src/IDF/conf/urls.php
471471
472472
473473
474
475
476
477
478
474479
475480
476481
'model' => 'IDF_Views_User',
'method' => 'changeEmailDo');
$ctl[] = array('regex' => '#^/preferences/email/(\d+)/delete/$#',
'base' => $base,
'model' => 'IDF_Views_User',
'method' => 'deleteMail');
$ctl[] = array('regex' => '#^/preferences/key/(\d+)/delete/$#',
'base' => $base,
'model' => 'IDF_Views_User',
src/IDF/templates/idf/user/myaccount.html
129129
130130
131131
132
133
134
135
136
137
138
139
140
132141
133142
134143
</tr>{/foreach}
</table>
{/if}
{if count($mailaddrs)>1}
<table summary=" " class="recent-issues">
<tr><th colspan="2">{trans 'Your additional email addresses'}</th></tr>
{foreach $mailaddrs as $mail}{if $mail.id != -1}<tr><td>
{$mail.address}</td><td> <form class="star" method="post" action="{url 'IDF_Views_User::deleteMail', array($mail.id)}"><input type="image" src="{media '/idf/img/trash.png'}" name="submit" value="{trans 'Delete this address'}" /></form>
</td>
</tr>{/if}{/foreach}
</table>
{/if}
{/block}
{block context}
<div class="issue-submit-info">

Archive Download the corresponding diff file

Page rendered in 0.08700s using 13 queries.