public function add() { if (!\Config::get('game-create-allowed')) { return \Redirect::to(\URL::previous()); } $message = null; if ($val = \Input::get('val')) { $validator = \Validator::make($val, ['title' => 'required|predefined|validalpha|min:3']); if (!$validator->fails()) { $game = $this->gameRepository->add($val); if ($game) { //send to game list if (\Config::get('game-create-allowed') and !\Auth::user()->isAdmin()) { $message = "<strong>Thanks for adding game:</strong> One of our administrator will now inspect your game and confirm very soon"; } else { return \Redirect::to($game->present()->url()); } } else { $message = trans('game.error'); } } else { $message = $validator->messages()->first(); } } return $this->preRender($this->theme->section('game.add', ['message' => $message, 'categories' => $this->categoryRepository->listAll()]), $this->setTitle(trans('game.add-games'))); }
public function setOnlineStatus() { $status = \Input::get('status'); if (\Auth::check()) { \Auth::user()->updateStatus($status, true); } }
public function index() { $message = null; if ($val = \Input::get('val')) { $this->inviteRepository->inviteMember($val); $message = trans('invite.success'); } return $this->render('invite.send', ['user' => \Auth::user(), 'message' => $message], ['title' => $this->setTitle(trans('invite.invite-friends'))]); }
public function remove($userid, $touserid, $way) { if ($userid != \Auth::user()->id and $touserid != \Auth::user()->id) { return 0; } if ($this->connectionRepository->remove($userid, $touserid, $way)) { return 1; } return 0; }
public function index() { if (!$this->exists()) { return $this->profileNotFound(); } if (\Auth::check() and $this->blockUserRepository->hasBlock(\Auth::user()->id, $this->profileUser->id)) { return \Redirect::route('user-home'); } echo $this->render('profile.index', [], ['title' => $this->setTitle()]); }
public function process() { usleep(2000000); $results = ['status' => 'login']; if (!\Auth::check()) { return json_encode($results); } $this->realTimeRepository->setType('update'); $results['status'] = true; $results['lastaccess'] = $this->realTimeRepository->getLastAccess(\Auth::user()->id); $messageUserId = \Input::get('messageuserid'); $postType = \Input::get('postType'); $currentTime = date('Y-m-d H:i:s', time()); $lastaccess = \Input::get('lastaccess'); $continue = true; $results['lastaccess'] = $this->realTimeRepository->getLastAccess(\Auth::user()->id); if ($this->realTimeRepository->has(\Auth::user()->id, 'notification', $lastaccess)) { $results['notifications'] = $this->notificationRepository->count(); $this->realTimeRepository->remove(\Auth::user()->id, 'notification'); $continue = false; } if ($this->realTimeRepository->has(\Auth::user()->id, 'friend-request', $lastaccess)) { $results['requests'] = $this->connectionRepository->countFriendRequest(); $this->realTimeRepository->remove(\Auth::user()->id, 'friend-request'); $continue = false; } if ($this->realTimeRepository->has(\Auth::user()->id, 'message', $lastaccess)) { if ($messageUserId) { $lastime = \Input::get('messagelastcheck'); if ($lastime) { $messages = $this->messageRepository->getList($messageUserId, 10, 0, $lastime); $results['messages'] = (string) $this->theme->section('messages.paginate', ['messages' => $messages]); } } $this->realTimeRepository->remove(\Auth::user()->id, 'message'); $continue = false; } clearstatcache(storage_path('realtime/')); $results['messagelastcheck'] = $currentTime; $results['postlastcheck'] = $currentTime; $results['onlines'] = $this->userRepository->countFriendsOnline(); $results['unreadmessage'] = $this->messageRepository->countNew(); if ($postType) { $lastime = \Input::get('postlastcheck'); if ($lastime) { $results['posts'] = (string) $this->theme->section('post.paginate', ['posts' => $this->postRepository->lists($postType, 0, \Input::get('postUserid'), $lastime)]); } } return json_encode($results); }
public function logout() { \Auth::logout(); \Session::flush(); //\Session::forget(); sleep(1); \Auth::logout(); if (\Auth::check()) { $user = \Auth::user(); $user->last_active_time = time() - 3600; $user->updateStatus(0); $user->save(); } return \Redirect::to('/'); }
public function mention() { return $this->render('discover.mention', ['posts' => $this->postRepository->search(\Auth::user()->present()->atName()), 'username' => \Auth::user()->present()->atName()], ['title' => $this->setTitle(trans('discover.@mention'))]); }
public function cropCover() { $top = \Input::get('top'); $image = $this->photo->cropImage(base_path(\Auth::getUser()->original_cover), 'cover/', 0, abs($top), 1000, 300, false); $image = str_replace('%d', 'original', $image->result()); if (!empty($image)) { /** * Update user profile cover */ $user = \Auth::user(); if ($user->cover and $user->cover != $user->original_cover) { \Image::delete($user->cover); } $this->userRepository->updateCover($image); return json_encode(['status' => 'success', 'url' => \Image::url($image)]); } else { return json_encode(['status' => 'error', 'message' => 'Error things']); } }
public function delete() { $userid = \Input::get('userid'); $userid = empty($userid) ? \Auth::user()->id : $userid; $delete = $this->userRepository->delete($userid); return \Redirect::to(\URL::previous()); }
public function index() { $data = Xcrud::get_instance()->table('inti_online_meeting_rooms')->columns('room_name,description,created_at')->fields('room_name,description')->label('room_name', 'Judul Rapat')->label('description', 'Deskripsi')->label('created_at', 'Tanggal Dibuat')->column_pattern('room_name', '<a href="https://rtc.intifadah.net/{slug}" class="xcrud-action" ><b color="red">{room_name}</a></b>')->pass_var('creator', \Auth::user()->id)->pass_var('created_at', date('Y-m-d H:i:s'))->before_insert('save_online_meeting', app_path() . '/config/function.php')->where("creator = '" . \Auth::user()->id . "'")->unset_title()->unset_limitlist()->unset_view()->unset_csv()->limit(10); return $this->render('webrtc.meeting.manage', ['data' => $data], ['title' => $this->setTitle(trans('global.about'))]); }
public function point($slug) { if (!$this->exists()) { return $this->notFound(); } $community = $this->communityRepostory->get($slug); if ($this->community->present()->isAdmin()) { $data = Xcrud::get_instance()->table('inti_community_points')->columns('workprogram_id,member_id,point,date,description')->fields('workprogram_id,member_id,point,date,description')->relation('member_id', 'inti_view_community_members', 'user_id', 'fullname', 'community_id = ' . $community->id, 'fullname', true)->relation('workprogram_id', 'inti_community_workprogram', 'id', 'program_name', 'community_id = ' . $community->id)->column_name('workprogram_id', 'Nama Program')->column_name('member_id', 'Anggota')->column_name('date', 'Tanggal')->column_name('description', 'Keterangan')->label('workprogram_id', 'Nama Program')->label('member_id', 'Anggota')->label('date', 'Tanggal')->label('description', 'Keterangan')->pass_var('community_id', $community->id)->where("inti_community_points.community_id = '" . $community->id . "'")->unset_title()->unset_limitlist()->unset_view()->sum('point')->unset_csv()->limit(10); } else { $data = Xcrud::get_instance()->table('inti_community_points')->columns('workprogram_id,member_id,point,date,description')->fields('workprogram_id,member_id,point,date,description')->relation('member_id', 'inti_view_community_members', 'user_id', 'fullname', 'community_id = ' . $community->id, 'fullname', true)->relation('workprogram_id', 'inti_community_workprogram', 'id', 'program_name', 'community_id = ' . $community->id)->column_name('workprogram_id', 'Nama Program')->column_name('member_id', 'Anggota')->column_name('date', 'Tanggal')->column_name('description', 'Keterangan')->label('workprogram_id', 'Nama Program')->label('member_id', 'Anggota')->label('date', 'Tanggal')->label('description', 'Keterangan')->pass_var('community_id', $community->id)->where("inti_community_points.community_id = '" . $community->id . "'")->where("inti_community_points.member_id like '%" . \Auth::user()->id . "%'")->unset_title()->unset_limitlist()->unset_view()->sum('point')->unset_edit()->unset_remove()->unset_add()->unset_csv()->limit(10); } return $this->render('community.page.manage', ['data' => $data, 'header' => 'Daftar Poin Anggota (SSKM)'], ['title' => $this->setTitle(trans('global.about'))]); }