Oops. Add DW::Settings::EmailAlias file.
Patch by kareila.
diffs (67 lines):
diff -r 7128b83b0d2e -r d4e35c18bc4f cgi-bin/DW/Setting/EmailAlias.pm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cgi-bin/DW/Setting/EmailAlias.pm Mon Jul 06 00:21:06 2009 +0000
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+#
+# DW::Setting::EmailAlias
+#
+# LJ::Setting module for choosing whether or not to disable email
+# forwarding via the site alias for a given user, as governed by the
+# "no_mail_alias" user property.
+#
+# Authors:
+# Jen Griffin <[email protected]>
+#
+# Copyright (c) 2009 by Dreamwidth Studios, LLC.
+#
+# This program is free software; you may redistribute it and/or modify it under
+# the same terms as Perl itself. For a copy of the license, please reference
+# 'perldoc perlartistic' or 'perldoc perlgpl'.
+#
+
+package DW::Setting::EmailAlias;
+use base 'LJ::Setting';
+use strict;
+use warnings;
+
+sub should_render {
+ my ( $class, $u ) = @_;
+ return $u && LJ::get_cap( $u, 'useremail' ) ? 1 : 0;
+}
+
+sub label {
+ my $class = shift;
+ return $class->ml( 'setting.emailalias.label' );
+}
+
+sub option {
+ my ( $class, $u, $errs, $args ) = @_;
+ my $key = $class->pkgkey;
+
+ my $emailalias = $class->get_arg( $args, "emailalias" ) || ! $u->prop(
"no_mail_alias" );
+
+ my $ret = LJ::html_check( {
+ name => "${key}emailalias",
+ id => "${key}emailalias",
+ value => 1,
+ selected => $emailalias ? 1 : 0,
+ } );
+
+ $ret .= " <label for='${key}emailalias'>";
+ $ret .= $class->ml( 'setting.emailalias.option', { user => $u->username,
domain => $LJ::USER_DOMAIN } );
+ $ret .= "</label>";
+
+ return $ret;
+}
+
+sub save {
+ my ( $class, $u, $args ) = @_;
+
+ my $val = $class->get_arg( $args, "emailalias" );
+ $u->set_prop( "no_mail_alias" => ! $val );
+
+ return 1;
+}
+
+1;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog