ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[livejournal] r15452: LJSUP-4422: Aliases for LJ users

Committer: ssafronova
LJSUP-4422: Aliases for LJ users
LJSUP-4552: change one alias max length to 400 bytes

U   trunk/cgi-bin/LJ/Widget/IPPU/AddAlias.pm
U   trunk/htdocs/friends/edit.bml
U   trunk/htdocs/manage/aliases.bml
Modified: trunk/cgi-bin/LJ/Widget/IPPU/AddAlias.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/IPPU/AddAlias.pm	2009-07-09 08:28:38 UTC (rev 15451)
+++ trunk/cgi-bin/LJ/Widget/IPPU/AddAlias.pm	2009-07-09 08:57:24 UTC (rev 15452)
@@ -34,8 +34,7 @@
     $body .= $class->html_text(
                 name  => 'alias',
                 id    => 'Widget[IPPU_AddAlias]_alias',
-				class => 'alias-value',
-                size  => 60,
+                size  => 30,
 				maxlength => 200,
                 value => $opts{alias},
                 raw   => "autocomplete='off'",
@@ -74,7 +73,7 @@
 
     my $is_edit = 0;
     $is_edit = 1 if $aliases->{$post->{foruser}} ne '';
-    my $prepared_alias = substr($post->{alias}, 0, 200);
+    my $prepared_alias = substr($post->{alias}, 0, 400);
     $aliases->{$user_for_alias->{userid}} = $prepared_alias if $prepared_alias;
     delete $aliases->{$user_for_alias->{userid}} unless $prepared_alias;
 

Modified: trunk/htdocs/friends/edit.bml
===================================================================
--- trunk/htdocs/friends/edit.bml	2009-07-09 08:28:38 UTC (rev 15451)
+++ trunk/htdocs/friends/edit.bml	2009-07-09 08:57:24 UTC (rev 15452)
@@ -108,9 +108,9 @@
 
             $ret .= "</th><th width='30%' style='text-align:left;'>$ML{'.editfriends.name'}</th>";
 
-            if ($remote->get_cap('aliases')) {
-                $ret .= "<th style='text-align:left;'>$ML{'.editfriends.alias'}</th>";
-            }
+			if ($remote->in_class('paid') || $remote->in_class('perm')) {
+            	$ret .= "<th style='text-align:left;'>$ML{'.editfriends.alias'}</th>";
+			}
             
             $ret .= "<th width='5%'>$ML{'.editfriends.friend'}</th></tr>";
 
@@ -138,22 +138,22 @@
                 $ret .= "<td$colors  style='text-align:left;'>" . LJ::ehtml($f->{'name'}) . "</td>\n";
 
                 my $who_u = LJ::load_user($who);
-                if ($remote->get_cap('aliases')) {
-                    $ret .= "<td style='text-align: left;'>";
-                    if ($who ne $authas) {
-                        $ret .= LJ::html_text({
-                                size => "30",
-                                maxlength => "200",
-                                name => "useralias_" . $who_u->{userid},
-                                id   => "useralias_$who",
-                                value => LJ::ljuser_alias($f->{username}),
-                                });
-                    } else { 
-                        $ret .= " ";
-                    }
+				if ($remote->in_class('paid') || $remote->in_class('perm')) {
+                	$ret .= "<td style='text-align: left;'>";
+                	if ($who ne $authas) {
+                    	$ret .= LJ::html_text({
+ 								size => "30",
+								maxlength => "200",
+                            	name => "useralias_" . $who_u->{userid},
+                            	id   => "useralias_$who",
+                            	value => LJ::ljuser_alias($f->{username}),
+                        		});
+                		} else { 
+                    	$ret .= " ";
+                		}
                         
-                    $ret .= "</td>";
-                }
+                		$ret .= "</td>";
+				}
 
                 $ret .= "<td align='center'>";
                 # non-checked checkboxes for "friend-of". checking these boxes adds the user
@@ -274,7 +274,7 @@
         $aliases = jsonToObj($aliases);
         foreach (grep { /^useralias/ } keys %POST) {
             my $key = my $who = $_;
-            my $value = substr($POST{$key}, 0, 200);
+            my $value = substr($POST{$key}, 0, 400);
             $who =~ s/^useralias_//;
             $aliases->{$who} = $value if (defined $value && $value ne '' && $who ne $remote->{userid});
             delete $aliases->{$who} unless $value;

Modified: trunk/htdocs/manage/aliases.bml
===================================================================
--- trunk/htdocs/manage/aliases.bml	2009-07-09 08:28:38 UTC (rev 15451)
+++ trunk/htdocs/manage/aliases.bml	2009-07-09 08:57:24 UTC (rev 15452)
@@ -7,7 +7,7 @@
     use vars qw(%GET %POST);
     use JSON;
 
-    my $max_alias_length = 200; # max allowed chars(?) or bytes in alias
+    my $max_alias_length = 400; # max allowed chars(?) or bytes in alias
 
     return LJ::server_down_html() if $LJ::SERVER_DOWN;
 

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments