| 267 | | if(isset($_GET["cmd"])){ |
| 268 | | |
| 269 | | $thesearch = new savedSearch($db); |
| 270 | | |
| 271 | | switch($_GET["cmd"]){ |
| 272 | | case "show": |
| 273 | | $securitywhere = ""; |
| 274 | | |
| 275 | | if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0){ |
| 276 | | |
| 277 | | $securitywhere = ""; |
| 278 | | |
| 279 | | foreach($_SESSION["userinfo"]["roles"] as $role) |
| 280 | | $securitywhere .= ", '".$role."'"; |
| 281 | | |
| 282 | | $securitywhere = " AND (`roleid` IN (''".$securitywhere.") OR `roleid` IS NULL)"; |
| 283 | | |
| 284 | | }//endif |
| 285 | | |
| 286 | | $thesearch->showLoad($_GET["tid"], $_SESSION["userinfo"]["uuid"], $securitywhere); |
| 287 | | break; |
| 288 | | |
| 289 | | case "getsearch": |
| 290 | | $thesearch->get($_GET["id"]); |
| 291 | | break; |
| 292 | | case "savesearch": |
| 293 | | $thesearch->save($_GET["name"],$_GET["tid"],$_SESSION["userinfo"]["uuid"]); |
| 294 | | break; |
| 295 | | case "deletesearch": |
| 296 | | $thesearch->delete($_GET["id"]); |
| 297 | | break; |
| 298 | | }//end switch |
| 299 | | }?> |
| | 267 | if(isset($_GET["cmd"])){ |
| | 268 | |
| | 269 | $thesearch = new savedSearch($db); |
| | 270 | |
| | 271 | switch($_GET["cmd"]){ |
| | 272 | |
| | 273 | case "show": |
| | 274 | |
| | 275 | $securitywhere = ""; |
| | 276 | |
| | 277 | if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0){ |
| | 278 | |
| | 279 | $securitywhere = ""; |
| | 280 | |
| | 281 | foreach($_SESSION["userinfo"]["roles"] as $role) |
| | 282 | $securitywhere .= ", '".$role."'"; |
| | 283 | |
| | 284 | $securitywhere = " AND (`roleid` IN (''".$securitywhere.") OR `roleid` IS NULL)"; |
| | 285 | |
| | 286 | }//endif |
| | 287 | |
| | 288 | if(!isset($_GET["tid"])) |
| | 289 | $error = new appError(200, "passed parameters not set"); |
| | 290 | |
| | 291 | $thesearch->showLoad($_GET["tid"], $_SESSION["userinfo"]["uuid"], $securitywhere); |
| | 292 | break; |
| | 293 | |
| | 294 | case "getsearch": |
| | 295 | |
| | 296 | if(!isset($_GET["id"])) |
| | 297 | $error = new appError(200, "passed parameters not set"); |
| | 298 | |
| | 299 | $thesearch->get($_GET["id"]); |
| | 300 | break; |
| | 301 | |
| | 302 | case "savesearch": |
| | 303 | |
| | 304 | if(!isset($_GET["tid"]) || !isset($_GET["name"])) |
| | 305 | $error = new appError(200, "passed parameters not set"); |
| | 306 | |
| | 307 | $thesearch->save($_GET["name"] ,$_GET["tid"], $_SESSION["userinfo"]["uuid"]); |
| | 308 | break; |
| | 309 | |
| | 310 | case "deletesearch": |
| | 311 | |
| | 312 | if(!isset($_GET["id"])) |
| | 313 | $error = new appError(200, "passed parameters not set"); |
| | 314 | |
| | 315 | $thesearch->delete($_GET["id"]); |
| | 316 | break; |
| | 317 | |
| | 318 | }//end switch |
| | 319 | |
| | 320 | }//endif |
| | 321 | ?> |