/[smeserver]/rpms/e-smith-email/sme7/e-smith-email-4.17.0-VisibleInternal.patch
ViewVC logotype

Contents of /rpms/e-smith-email/sme7/e-smith-email-4.17.0-VisibleInternal.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Tue Mar 11 17:12:06 2008 UTC (16 years, 7 months ago) by slords
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Import on branch sme7 of package e-smith-email-4.18.0-1.el4.sme.src.rpm

1 diff -uNr e-smith-email-4.17.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/pseudonyms e-smith-email-4.17.0-VisibleInternalUI/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/pseudonyms
2 --- e-smith-email-4.17.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/pseudonyms 2007-06-28 14:42:04.000000000 +0200
3 +++ e-smith-email-4.17.0-VisibleInternalUI/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/pseudonyms 2007-06-28 14:41:55.000000000 +0200
4 @@ -72,6 +72,10 @@
5 <trans>Select account or group</trans>
6 </entry>
7 <entry>
8 + <base>SELECT_INTERNAL</base>
9 + <trans>Local network only</trans>
10 + </entry>
11 + <entry>
12 <base>CLICK_TO_CREATE</base>
13 <trans>Add pseudonym</trans>
14 </entry>
15 diff -uNr e-smith-email-4.17.0/root/etc/e-smith/web/functions/pseudonyms e-smith-email-4.17.0-VisibleInternalUI/root/etc/e-smith/web/functions/pseudonyms
16 --- e-smith-email-4.17.0/root/etc/e-smith/web/functions/pseudonyms 2003-04-11 17:21:25.000000000 +0200
17 +++ e-smith-email-4.17.0-VisibleInternalUI/root/etc/e-smith/web/functions/pseudonyms 2007-06-27 17:20:07.000000000 +0200
18 @@ -159,6 +159,15 @@
19 <label>SELECT_ACCOUNT</label>
20 </field>
21
22 + <field
23 + id="internal"
24 + type="select"
25 + display="is_pseudonym_not_removable()"
26 + options="YES => 'yes', NO => 'no'"
27 + value="is_pseudonym_internal()">
28 + <label>SELECT_INTERNAL</label>
29 + </field>
30 +
31 <subroutine src="print_button('SAVE')"/>
32 </page>
33
34 diff -uNr e-smith-email-4.17.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/pseudonyms.pm e-smith-email-4.17.0-VisibleInternalUI/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/pseudonyms.pm
35 --- e-smith-email-4.17.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/pseudonyms.pm 2007-06-27 16:54:00.000000000 +0200
36 +++ e-smith-email-4.17.0-VisibleInternalUI/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/pseudonyms.pm 2007-06-27 17:20:07.000000000 +0200
37 @@ -29,6 +29,8 @@
38 print_begin_page
39 print_hidden_pseudonym_field
40 get_pseudonym_account
41 + is_pseudonym_internal
42 + is_pseudonym_not_removable
43 validate_new_pseudonym_name
44 validate_is_pseudonym
45 );
46 @@ -202,8 +204,17 @@
47
48 my $pseudonym = uri_unescape($q->param ('pseudonym'));
49 my $account = $q->param ('account');
50 + my $internal = $q->param ('internal') || 'NO';
51 + my $removable = $accounts->get($pseudonym)->prop('Removable') || 'yes';
52
53 - $accounts->get($pseudonym)->set_prop('Account', $account)
54 + my %props = ('Account' => $account);
55 +
56 + if ($removable eq 'yes') {
57 + if ($internal eq "YES") { $props{'Visible'} = 'internal'; }
58 + else { $accounts->get($pseudonym)->delete_prop('Visible'); }
59 + }
60 +
61 + $accounts->get($pseudonym)->set_prop(%props)
62 or $msg = "Error occurred while modifying pseudonym in database.";
63
64 # Untaint $pseudonym before use in system()
65 @@ -215,6 +226,7 @@
66 {
67 $q->delete('account');
68 $q->delete('pseudonym');
69 + $q->delete('internal');
70 $fm->success('MODIFY_SUCCEEDED');
71 }
72 else
73 @@ -418,6 +430,42 @@
74 }
75 # }}}
76
77 +# {{{ is_pseudonym_not_removable
78 +
79 +=head2 is_pseudonym_not_removable
80 +
81 +Returns 1 if the current Account is not removable, 0 otherwise
82 +
83 +=cut
84 +
85 +sub is_pseudonym_not_removable {
86 + my $fm = shift;
87 + my $q = $fm->{'cgi'};
88 + my $pseudonym = $q->param('pseudonym');
89 + my $removable = $accounts->get($pseudonym)->prop('Removable') || 'yes';
90 + return 1 if ($removable eq 'yes');
91 + return 0;
92 +}
93 +# }}}
94 +
95 +# {{{ is_pseudonym_internal
96 +
97 +=head2 is_pseudonym_internal
98 +
99 +Returns YES if the current Account property Visible is 'internal'
100 +
101 +=cut
102 +
103 +sub is_pseudonym_internal {
104 + my $fm = shift;
105 + my $q = $fm->{'cgi'};
106 + my $pseudonym = $q->param('pseudonym');
107 + my $visible = $accounts->get($pseudonym)->prop('Visible') || '';
108 + return 'YES' if ($visible eq 'internal');
109 + return 'NO';
110 +}
111 +# }}}
112 +
113 # {{{ validate_new_pseudonym_name
114
115 =head2 validate_new_pseudonym_name FM PSEUDONYM

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed