Example #1
0
 public function activate()
 {
     //TODO: Implement this action.
     $uid = $_GET["uid"];
     $hash = $_GET["hash"];
     if (User::activateUser($uid, $hash)) {
         echo "active";
         User::loginSystem(User::fromUid($uid));
     }
     Page::redirect("/index");
 }
Example #2
0
 public function view_user()
 {
     RoutingEngine::setPage("runnDAILY", "PV__300");
     RoutingEngine::getInstance()->registerParams("uid");
     if (!isset($_GET["uid"])) {
         Page::redirect("/community");
     }
     $uid = $_GET["uid"];
     //$routes = Route::getRoutesForUserInArray($uid, 50);
     $routes = Route::sql()->select("r_id, r_name, r_distance, r_creation, r_description")->where_eq("r_uid", $uid)->orderby("r_creation")->limit(50)->execute(false, true, "r_id");
     //$routes_js = json_encode_null($routes);
     RoutingEngine::getSmarty()->assign("routes", $routes);
     //RoutingEngine::getSmarty()->assign("routes_js", $routes_js);
     //$index_items = TrainingLog::getIndexItemsForUser($uid);
     $index_items = TrainingLog::sql()->select("r_name, t_rid, t_tid, t_time, t_distance, t_pace, t_date, t_comment")->leftjoin("routes", "r_id", "t_rid", false)->where_eq("t_uid", $uid)->orderby("t_date")->orderby("t_distance")->limit(50)->execute(false, true);
     //$json_data = TrainingLog::buildChartData($index_items);
     RoutingEngine::getSmarty()->assign("training_index_items", $index_items);
     //RoutingEngine::getSmarty()->assign("JSON_Chart_Data", $json_data);
     //var_dump(User::$current_user);
     RoutingEngine::getSmarty()->assign("user", User::fromUid($uid));
 }