public function get_profile() { $id = $_GET['id']; $user = new users(); $res = $user->find($id); echo json_encode($res); }
public function up() { $users = users::find()->all(); foreach ($users as $user) { $user->auth_key = Yii::$app->getSecurity()->generateRandomString(); $user->save(); } }
<?php if (!isset($_POST['request'])) { die("No posted data"); } require "nm-controller.php"; $action = $_SERVER['QUERY_STRING']; $xml = new SimpleXMLElement(stripslashes($_POST['request'])) or die("Invalid XML"); //Create a network if ($action == "create") { //validate user if (users::find((string) $xml->auth, true) === false) { die("Authkey invalid"); } $nn = NeuralMesh::createNetwork((int) $xml->inputs, (int) $xml->outputs, (int) $xml->hidden, (int) $xml->layers); echo "<response><authkey>{$nn->authkey}</authkey></response>"; exit; } else { $nn = NeuralMesh::getNetwork($xml->auth); } switch ($action) { case "destory": $nn->destroy(); break; /** * Run the network */ /** * Run the network */ case "run":