Online Code

<?//// phpMount - A PHP mount Interface// http://phpmount.sourceforge.net///// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License// as published by the Free Software Foundation; either version 2// 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 General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.////

// local transferpath is given by the user and should be at least 1 char, otherwise we default to nothing // if there's no value we won't return a link in the device-contentif (strlen(trim($strLocalTransferPath)) > 0)$this->localtransferpath = trim($strLocalTransferPath); else$this->localtransferpath = "";

// copyto is given by the user and should be at least 1 char, otherwise we default to "/tmp"if (strlen(trim($strCopyTo)) > 0)$this->copyto = trim($strCopyTo); else$this->copyto = "/tmp";

// Refresh all stats on a devicefunction refresh() {$this->icon = $this->_getIcon();// If this object is mounted we get the size, free space and filesystemif ($this->getStatus() == "mount") {$this->size = $this->_getDeviceInfo("SIZE");$this->free = $this->_getDeviceInfo("FREE");$this->filesystem = $this->_getDeviceInfo("FILESYSTEM"); } else// It is not mounted, go back to the defaults{$this->size = $unknown;$this->free = $unknown;$this->filesystem = $unknown; } }

// Get the current status (mount/umount) // No variables because we only allow the device/mountpoint attached to this classfunction getStatus() { if ($this->_status($this->device,$this->mountpoint)) return "mount"; else return "umount"; }

<?//// phpMount//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License// as published by the Free Software Foundation; either version 2// 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 General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.////session_start();