# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . global $_USER; if ($_POST) { if ($_USER['twitter_username'] && ($_USER['twitter_username'])) { if ($_USER['post_tweets'] == '1') $twitter = true; else $twitter = false; } else $twitter = false; if ($_POST['usemobile']) { if(!$_POST['note']) header(BASE.'mobile'); $post = postNote($_POST['note'], $_USER, 'mobile', $_POST['auth'], false, false, $twitter); } else { $post = postNote($_POST['note'], $_USER, 'web', $_POST['auth'], false, false, $twitter); } if($post) { switch ($post) { case 'BIG_FILE': $error = __('The uploaded file is too big'); break; case 'FILE_NOT_ALLOWED': $error = __('The uploaded file is not allowed'); break; case 'SHORT_NOTE': $error = __('The note is too short'); break; case 'LONG_NOTE': $error = __('The note is too long'); break; case 'INVALID': $error = __('You are not logged in correctly.'); break; case 'INVALID_USER': $error = __('The user doesn\'t exist'); break; /*case 'INVALID_GROUP': $error = __('Group doesn\'t exist'); break;*/ case 'NOT_FOLLOWING': $error = __('The user isn\'t following you'); break; case 'CANT_SEND_OWN_USER': $error = __('You cant\'t send a private note to yourself'); break; case 'COWBOY': $error = __('Cowboy!'); break; } if($error) { echo showStatus($error, 'warning'); } else { header('Location: '.$_SERVER['HTTP_REFERER']); } } } ?>