wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r9390: LJSUP-6590. admin can create userhead wi...

Committer: gprochaev
LJSUP-6590. admin can create userhead without picture

U   trunk/htdocs/admin/userheads/manage.bml
Modified: trunk/htdocs/admin/userheads/manage.bml
===================================================================
--- trunk/htdocs/admin/userheads/manage.bml	2010-08-25 04:30:31 UTC (rev 9389)
+++ trunk/htdocs/admin/userheads/manage.bml	2010-08-25 04:39:08 UTC (rev 9390)
@@ -21,13 +21,12 @@
     seek $userhead->fh, 0,0;
     read $userhead->fh, my $userhead_content, $userhead->size;
 
-    my $uh = LJ::UserHead->new;
-    $uh->save;
+    if ($POST{'uh_file'}) {
+        my $uh = LJ::UserHead->new;
+        $uh->save;
 
-    my ($result_l, $result_s, $content_length, $magic, $mime_type) = ();
+        my ($result_l, $result_s, $content_length, $magic, $mime_type) = ();
 
-    ## Set large image
-    if ($POST{'uh_file'}) {
         $content_length = bytes::length($POST{'uh_file'});
         $magic = substr $POST{'uh_file'}, 0, 20;
         $mime_type = format_magic($magic)
@@ -56,6 +55,7 @@
     my $uh = LJ::UserHead->get_userhead ($FORM{'uh_id'});
     foreach my $user (split /,[ ]?/, $FORM{'users'}) {
         my $u = LJ::load_user ($user);
+        next unless $u;
         $u->set_custom_usericon ($uh->get_uh_img);
     }
 }

Tags: bml, ljcom, wisest-owl
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