Source for file action.php
Documentation is available at action.php
* Project: deskweb - the dekstop manager for web <br />
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library 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
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You may contact the authors of Deskweb by emial at: <br />
* Massimiliano Balestrieri <br />
* The latest version of deskweb can be obtained from: <br />
* http://www.deskweb.org/ <br />
* @link http://www.deskweb.org/
* @author Massimiliano Balestrieri <io@maxb.net>
* @copyright 2005-2006 Massimiliano Balestrieri.
switch ($request->action) {
$session->setFullscreen();
$session->removeFromActive($request->id);
$session->removeOtherActive($request->id);
///////////////////////////AZIONI
//print_r($request->form);
if (isset
($request->form['action'])) {
switch ($request->form['action']) {
if ($session->getAuthAttempt() <
3) {
$sql =
"select id_user,username,pass,fk_firstgroup,desktop_bg from ".
PREFIX_DB.
"users where username='".
$request->form['user_utente'].
"'";
if ($dati[0]['pass'] ==
md5($request->form['p_utente'])) {
$session->authFromForm($dati[0]);
$session->addAuthAttempt();
$sql =
"select username,pass,fk_firstgroup,desktop_bg from ".
PREFIX_DB.
"users where username='".
$request->form['user_utente'].
"'";
$sql =
"select id_user from ".
PREFIX_DB.
"users order by id_user desc limit 1";
$new_id_user = ++
$new_id_user[0]['id_user'];
//$sql = "select id_group from ".PREFIX_DB."groups order by id_group desc limit 1";
//$new_id_group = MySqlDao :: getDati($sql);
//$new_id_group = ++$new_id_group[0]['id_group'];
//$sql = "insert into ".PREFIX_DB."groups (id_group,groupname) values('".$new_id_group."','".$request->form['user_utente']."')";
//$id_group = MySqlDao :: insertDati($sql);
$sql =
"insert into ".
PREFIX_DB.
"users (id_user,username,pass,mail,fk_firstgroup,desktop_bg) values('".
$new_id_user.
"','".
$request->form['user_utente'].
"','".
md5($request->form['p_utente']).
"','".
$request->form['email'].
"','".
$new_id_group.
"','".
$request->form['color'].
"')";
$sql =
"select id_user,username,pass,fk_firstgroup,desktop_bg from ".
PREFIX_DB.
"users where username='".
$request->form['user_utente'].
"'";
$session->authFromForm($dati[0]);
if (isset
($request->form['n'])) {
switch ($request->form['n']) {
$req =
$session->getPreviousRequest();
$req =
$session->getNextRequest();
if (!isset
($request->form['id_node']))
if (!isset
($request->form['id_node']))
$session->registerCopy($tree);
//echo "<pre>".print_r($tree,true)."</pre>";
$copy =
$session->getClipboardCopy();
//echo "<pre>".print_r($copy,true)."</pre><hr>";
$destinazione_iniziale =
$request->id;
for ($x =
0; $x <=
sizeof($copy) -
1; $x ++
) {
//echo strpos($copy[$x]['clone'],"{destination}")."<hr>";
if (strpos($copy[$x]['clone'], "{destination}") >
0) {
$sql =
str_replace("{destination}", $destinazione_iniziale, $copy[$x]['clone']);
//echo $copy[$x]['clone']."<hr>";
$parent =
substr($copy[$x]['fk_parent'], 1, strlen($copy[$x]['fk_parent']) -
2);
$sql =
str_replace($copy[$x]['fk_parent'], $new_id[$parent], $copy[$x]['clone']);
//echo $copy[$x]['clone']."<hr>";
$new_id[$copy[$x]['id_node']] =
$id;
//echo "<pre>".print_r($new_id,true)."</pre><hr>";
$session->purgeClipboard();
if ($session->getClipboardFrom() !=
$request->id) {
$sql =
"update ".
PREFIX_DB.
"node set fk_parent = '".
$request->id.
"' where id_node in(".
join(",", $session->getClipboardNodes()).
");";
$session->purgeClipboard();
if (!isset
($request->form['id_node']))
//echo "<pre>".print_r($tree,true)."</pre><hr>";
$sql =
"delete from ".
PREFIX_DB.
"node where id_node in(".
join(",", $tree).
")";
$sql =
"delete from ".
PREFIX_DB.
"node where id_node = '".
$request->id.
"' limit 1";
header("Location:".
MAIN.
"?id=".
$session->getPublic());
header("Location:".
MAIN.
"?id=".
$session->getHomeCurrentUser());
$session->setFullscreen();
if (isset
($request->form['annulla']) ||
(isset
($request->form['action']) &&
$request->form['action'] ==
ACTION_TEXT_ANNULLA))
if ($session->getCurrentUser() >
0) {
if (count($request->form) >
0 &&
!isset
($request->form['applicazione'])) {
if (isset
($request->form['type'])) {
switch ($request->form['type']) {
//////////////////////////////////////////////////////////CREA DIRECTORY//////////////////////////////////////////////////////////
if (@ strlen($request->form['icona']) ==
0)
$request->form['icona'] =
"cartella.png";
$request->form['node'] =
$request->form['nome_file'];
$request->form['application'] =
"dwnautilus";
$request->form['have_child'] =
1;
if (@ strlen($request->form['icona']) ==
0)
$request->form['icona'] =
"html.png";
$request->form['node'] =
$request->form['nome_file'];
$request->form['application'] =
"dweditor";
$request->form['have_child'] =
0;
if (@ strlen($request->form['icona']) ==
0)
$request->form['icona'] =
'doc.png';
$request->form['node'] =
$request->form['nome_file'];
$request->form['application'] =
"dweditor";
$request->form['have_child'] =
0;
if (@ strlen($request->form['icona']) ==
0)
$request->form['icona'] =
"kate.png";
$request->form['node'] =
$request->form['nome_file'];
$request->form['application'] =
"dwnano";
$request->form['have_child'] =
0;
if (@ strlen($request->form['icona']) ==
0)
$request->form['icona'] =
"browser.png";
$request->form['node'] =
$request->form['nome_file'];
$request->form['application'] =
"dweditor";
$request->form['have_child'] =
0;
if (@ strlen($request->form['icona']) ==
0)
$request->form['icona'] =
"web.png";
if (!isset
($request->form['link'])) {
$request->form['link'] =
substr($request->form['nome_file'], strpos($request->form['nome_file'], "#") +
1);
$request->form['nome_file'] =
substr($request->form['nome_file'], 0, strpos($request->form['nome_file'], "#"));
$request->form['node'] =
$request->form['nome_file'].
"#".
$request->form['link'];
$request->form['application'] =
null;
$request->form['have_child'] =
0;
$request->form['node'] =
$request->form['nome_file'];
$request->form['application'] =
"dwnano";
$request->form['icona'] =
"klipper.png";
$request->form['have_child'] =
0;
$permessi =
$request->recuperaPermessi();
$sql =
"insert into ".
PREFIX_DB.
"node(node,fk_parent,type,application,icon,last_date,permissions,have_child,fk_user,fk_group)values(".
"'".
$request->form['node'].
"',".
"'".
$request->id.
"',".
"'".
$request->form['type'].
"',".
"'".
$request->form['application'].
"',".
"'".
$request->form['icona'].
"',".
"'".
date("Y-m-d H:i:s").
"',".
"'rwx---".
$permessi.
"',".
"'".
$request->form['have_child'].
"',".
"'".
$session->getCurrentUser().
"',".
"'".
$session->getCurrentGroup().
"')";
if (@ strlen($request->form['node']) >
0)
Documentation generated on Sun, 18 Jun 2006 23:16:13 +0200 by phpDocumentor 1.3.0RC6