Go to the source code of this file.
Functions | |
set_header () | |
Start the display of a www page. | |
set_footer () | |
close a web page | |
warning ($msg) | |
print a warning | |
error ($where, $what) | |
print an error message and exit | |
letal ($what, $where) | |
print a letal error message and die | |
ssh_passthru ($remote, $password, $command, $status) | |
Execute a single command remotely using ssh and return its entire output (like passthru). | |
ssh_copy ($origin, $destination, $password) | |
Copy a file or directory from one source to a destination. | |
ssh_open ($remote, $password) |
|
print an error message and exit Whenever we detect something wrong, we must tell the user. This function will take an error message as its argument, format it suitably and spit it out.
Definition at line 104 of file util.php. Referenced by letal(). |
|
print a letal error message and die This function is called whenever a letal error (one that prevents further processing) is detected. The function will spit out an error message, close the page and exit the program. It should seldomly be used, since it may potentially disrupt the page layout (e.g. amid a table) by not closing open tags of which it is unaware. Actually it is a wrapper for error + terminate.
Definition at line 138 of file util.php. References error(), exit, and set_footer(). Referenced by ssh_open(). |
|
close a web page Make sure we end the page with all the appropriate formulisms: close the body, include copyright notice, state creator and any needed details, and close the page. Definition at line 54 of file util.php. Referenced by letal(). |
|
Start the display of a www page. We have it as a function so we can customise all pages generated as needed. This routine will open HTML, create the page header, and include any needed style sheets (if any) to provide a common look-and-feel for all pages generated. |
|
Copy a file or directory from one source to a destination. This function copies source to dest, where one of them is a local filespec and the other a remote filespec of the form [user@]host:path If the original source is a directory, it will be copied recursively to destination (hence easing file transfers). The function returns TRUE on success or FALSE on failure. |
|
Definition at line 224 of file util.php. References $debug, $descriptorspec, $fp, $process, $tmpfname, letal(), and warning(). |
|
Execute a single command remotely using ssh and return its entire output (like passthru). This might be done as well using a pipe on /tmp and making the command 'cat' the pipe: when ssh runs, it runs the command 'cat' on the pipe and hangs on read. Then we just need a thread to open the pipe, put the password and close the pipe. This other way the password is never wirtten down. But, OTOH, the file life is so ephemeral that most of the time it will only exist in the internal system cache, so this approach is not that bad either.
|
|
print a warning Prints a warning in a separate pop-up window. A warning is issued when a non-critical problem has been detected. Execution can be resumed using some defaults, but the user should be notified. In order to not disrupt the web page we are displaying we use a JavaScript pop-up alert to notify the user.
Definition at line 81 of file util.php. Referenced by ssh_open(). |