Changeset 2467


Ignore:
Timestamp:
02/15/09 22:46:11 (4 years ago)
Author:
nahuel
Message:

Permit the alternc's user to delete an application

Location:
alternc-apps/trunk/bureau
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • alternc-apps/trunk/bureau/class/m_apps.php

    r2463 r2467  
    5151      
    5252     $r=array(); 
    53      $db->query("SELECT uid, application, path FROM applications WHERE uid='$cuid' ORDER BY path"); 
     53     $db->query("SELECT uid, application, path FROM applications WHERE uid='$cuid' AND installed = 1 ORDER BY path"); 
    5454     if ($db->num_rows()) { 
    5555         while ($db->next_record()) { 
     
    116116   } 
    117117 
     118   function delete_app($appname, $path) 
     119   { 
     120      global $db,$cuid, $mem, $L_ALTERNC_LOC; 
     121 
     122      if( FALSE === array_search($appname,$this->get_apps_list())){ 
     123          return false; 
     124      } 
     125 
     126      $realpath = "$L_ALTERNC_LOC/html/" .substr($mem->user["login"],0,1)."/".$mem->user["login"]."/$path"; 
     127 
     128      if( !file_exists($realpath)){ 
     129          return false; 
     130      } 
     131 
     132      $db->query("UPDATE applications SET installed=2 WHERE uid='$cuid' AND application = '$appname' AND path = '$realpath'"); 
     133      return true; 
     134   } 
     135 
    118136} 
    119137 
Note: See TracChangeset for help on using the changeset viewer.