& Matías Parodi # # 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 . # ## /* This is NOT the final API, just an easy code for test Jisko Mobile Sender. We need to develop something better -- Rubén Díaz */ define("SECURITY", 1); include('./config.php'); mysql_pconnect(DB_HOST, DB_USER, DB_PASSWORD); mysql_select_db(DB_NAME); include('./includes/functions.php'); if ($_GET) { $api = safe_str($_GET['api'], true); $username = safe_str($_GET['username'], true); $note = safe_str($_GET["note"], true); // $from = safe_str($_GET["from"], true); $from = 'api'; // in the future, we can put the name of app used in this or another var $sql = "SELECT `users`.`id_user` FROM `users` WHERE ((`users`.`username` = '$username') AND (`users`.`api` = '$api'));"; $result = mysql_query($sql); if (mysql_affected_rows() != 0) { $row = mysql_fetch_assoc($result); mysql_free_result($result); $id_user = $row['id_user']; post_note($note, $from, $id_user); } else { echo 'ERROR (bad credentials)'; } } ?>