示例#1
0
 public function updateCommentary()
 {
     /* @var $user User */
     $uid = Input::get('uid');
     $user = User::find($uid);
     $user->commentary = Input::get('user_commentary');
     $user->monitored = Input::get('monitored');
     if (Input::get('password') == Input::get('re-password') && Input::get('re-password') != '') {
         $user->password = Hash::make(Input::get('re-password'));
     }
     // Update announcement info.
     $oldAnnouncement = $user->announcement_stream;
     $user->announcement_stream = Input::get('announcement_stream');
     // New announcements will start next day.
     if ($oldAnnouncement != $user->announcement_stream) {
         $start = new Carbon\Carbon();
         $start->setTime(0, 0, 0)->addDay();
         $user->announcement_start = $start;
         $user->announcement_expires = $start->addDays(Config::get('announcements.duration'));
     }
     if (Input::get('showRegion') == 1) {
         $user->show_continent = 1;
     }
     if (Input::get('showDot') == 1) {
         $user->show_dot = 1;
     }
     if (Input::get('showRegion') == 0) {
         $user->show_continent = 0;
     }
     if (Input::get('showDot') == 0) {
         $user->show_dot = 0;
     }
     $user->save();
     return Redirect::back();
 }