diff --git a/Documents/test.txt b/Documents/test.txt
new file mode 100755
index 0000000..ca90ccb
--- /dev/null
+++ b/Documents/test.txt
@@ -0,0 +1 @@
+You have successfuly installed OWL.
diff --git a/admin/admin_dbmodify.php b/admin/admin_dbmodify.php
new file mode 100755
index 0000000..9b899e4
--- /dev/null
+++ b/admin/admin_dbmodify.php
@@ -0,0 +1,134 @@
+query("SELECT * FROM $default->owl_users_table WHERE id = '$id'");
+ $sql->next_record();
+ $newpass = $sql->f("password");
+ if ($newpass == $password) {
+ $sql->query("UPDATE $default->owl_users_table SET groupid='$groupid',username='$loginname',name='$name',password='$password',quota_max='$quota', email='$email',notify='$notify',email='$email',attachfile='$attachfile',disabled='$disabled',noprefaccess='$noprefaccess',language='$newlanguage',maxsessions='$maxsessions' where id = '$id'");
+ }
+ else
+ {
+ $sql->query("UPDATE $default->owl_users_table SET groupid='$groupid',username='$loginname',name='$name',password='" . md5($password) ."',quota_max='$quota', email='$email', notify='$notify',attachfile='$attachfile',disabled='$disabled',noprefaccess='$noprefaccess',language='$newlanguage',maxsessions='$maxsessions' where id = '$id'");
+ }
+ // Bozz Change BEGIN
+
+ // Clean Up the member group table first
+
+ $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id");
+
+ // Insert the new Choices the member group table with selected groups
+ for ( $i = 0 ; $i <= $no_groups_displayed; $i++ ) {
+ $checkboxfields = 'group' . $i;
+ if($$checkboxfields != '') {
+ $checkboxvalue = $$checkboxfields;
+ $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$id', '$checkboxvalue')");
+ }
+ }
+ /* Bozz Change END */
+ header("Location: index.php?sess=$sess&action=users&owluser=$id&change=1");
+}
+
+if($action == "group") {
+ global $default;
+ $sql = new Owl_DB;
+ $sql->query("UPDATE $default->owl_groups_table SET name='$name' where id = '$id'");
+ header("Location: index.php?sess=$sess&action=groups&group=$id&change=1");
+}
+
+// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php
+if($action == $lang_deleteuser) {
+// END BUG FIX: #448232 mistake in admin_dbmodify.php
+ $sql = new Owl_DB;
+ $sql->query("DELETE FROM $default->owl_users_table WHERE id = '$id'");
+ // Bozz Change Begin
+ // Also Clean up the groupmember table when a user is deleted
+ $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id");
+ // Bozz Change End
+ header("Location: index.php?sess=$sess&action=users");
+}
+
+if($action == "edhtml") {
+ $sql = new Owl_DB;
+ $sql->query("UPDATE $default->owl_html_table SET table_border='$border', table_header_bg='$header_bg', table_cell_bg='$cell_bg',table_cell_bg_alt='$cell_bg_alt',body_bgcolor='$body_bgcolor',body_textcolor='$body_textcolor',body_link='$body_link',body_vlink='$body_vlink',table_expand_width='$expand_width',table_collapse_width='$collapse_width', main_header_bgcolor='$main_header_bgcolor' ");
+
+ header("Location: index.php?sess=$sess&action=edhtml&change=1");
+
+}
+
+if($action == "edprefs") {
+ $sql = new Owl_DB;
+
+ if ($lookAtHD != "false" )
+ $lookAtHD = "true";
+ if ($owl_expand != "1")
+ $owl_expand = "0";
+ if ($version_control != "1")
+ $version_control = "0";
+
+ $sql->query("UPDATE $default->owl_prefs_table SET email_from='$email_from', email_fromname='$email_fromname', email_replyto='$email_replyto', email_server='$email_server', lookAtHD='$lookAtHD', def_file_security='$def_file_security', def_file_group_owner='$def_file_group_owner', def_file_owner='$def_file_owner', def_file_title='$def_file_title', def_file_meta='$def_file_meta', def_fold_security='$def_fold_security', def_fold_group_owner='$def_fold_group_owner', def_fold_owner='$def_fold_owner', max_filesize='$max_filesize', timeout='$owl_timeout', expand='$owl_expand', version_control='$version_control', restrict_view='$restrict_view', dbdump_path='$dbdump_path', gzip_path='$gzip_path', tar_path='$tar_path'");
+
+ header("Location: index.php?sess=$sess&action=edprefs&change=1");
+}
+
+// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php
+if($action == $lang_deletegroup ) {
+// END BUG FIX: #448232 mistake in admin_dbmodify.php
+ global $default;
+ $sql = new Owl_DB;
+ $sql->query("DELETE FROM $default->owl_groups_table WHERE id = '$id'");
+ header("Location: index.php?sess=$sess&action=groups");
+}
+
+if($action == "add") {
+ if($type == "user") {
+ $maxsessions = $maxsessions - 1; // always is stored - 1
+ $sql = new Owl_DB;
+ $sql->query("SELECT * FROM $default->owl_users_table WHERE username = '$loginname'");
+ if($sql->num_rows($sql) > 0) die ("$lang_err_user_exists");
+ $sql->query("INSERT INTO $default->owl_users_table (groupid,username,name,password,quota_max,quota_current,email,notify,attachfile,disabled,noprefaccess,language,maxsessions) VALUES ('$groupid', '$loginname', '$name', '" . md5($password) . "', '$quota', '0', '$email', '$notify','$attachfile', '$disabled', '$noprefaccess', '$newlanguage', '$maxsessions')");
+ // Bozz Change BEGIN
+ // Populated the member group table with selected groups
+ $sql->query("SELECT id FROM $default->owl_users_table WHERE username = '$loginname'");
+ $sql->next_record();
+ $newuid = $sql->f("id");
+ for ( $i = 0 ; $i <= $no_groups_displayed; $i++ ) {
+ $checkboxfields = 'group' . $i;
+ if($$checkboxfields != '') {
+ $checkboxvalue = $$checkboxfields;
+ $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$newuid', '$checkboxvalue')");
+ }
+ }
+ /* Bozz Change END */
+ if($home == "1") {
+ $sql->query("select * from $default->owl_users_table where username = '$loginname'");
+ while($sql->next_record()) $id = $sql->f("id");
+ $sql->query("insert into $default->owl_folders_table values (0, '$loginname', '2', '54', '$groupid', '$id')");
+ mkdir($default->owl_fs_root."/".fid_to_name("1")."/Home/$loginname", 0777);
+ }
+ header("Location: index.php?sess=$sess");
+ } elseif($type == "group") {
+ $sql = new Owl_DB;
+ $sql->query("INSERT INTO $default->owl_groups_table (name) VALUES ('$name')");
+ header("Location: index.php?sess=$sess");
+ }
+}
+
+?>
diff --git a/admin/index.php b/admin/index.php
new file mode 100755
index 0000000..d703b29
--- /dev/null
+++ b/admin/index.php
@@ -0,0 +1,534 @@
+");
+
+if($usergroupid != "0") die("$lang_err_unauthorized");
+
+if(!isset($action)) $action = "users";
+
+function printusers() {
+ global $sess, $default, $lang_users;
+
+ $sql = new Owl_DB;
+ $sql_active_sess = new Owl_DB;
+
+ $sql->query("select username,name,id,maxsessions from $default->owl_users_table order by name");
+
+
+ /* print("
| table_header_bg>$lang_users |
");
+
+
+ print(" |
"); */
+
+
+ print("table_border>| table_header_bg>$lang_users | table_header_bg>  |
");
+
+
+ while($sql->next_record()) {
+ $uid = $sql->f("id");
+ $username = $sql->f("username");
+ $name = $sql->f("name");
+ $maxsess = $sql->f("maxsessions") + 1;
+ $numrows = 0;
+
+ $sql_active_sess->query("select * from $default->owl_sessions_table where uid = $uid");
+ $sql_active_sess->next_record();
+ $numrows = $sql_active_sess->num_rows($sql_active_sess);
+
+ if ($name == "")
+ print("| ".$username." | ");
+ else
+ print("
| ".$name." | ");
+ print("(".$numrows."/".$maxsess.") |
");
+ }
+ print("
");
+}
+
+function printgroups() {
+ global $sess, $lang_groups, $default;
+ $sql = new Owl_DB;
+ $sql->query("select name,id from $default->owl_groups_table order by name");
+ print("table_border>| table_header_bg>$lang_groups |
");
+ while($sql->next_record()) {
+ print("| ".$sql->f("name")." |
");
+ }
+ print("
");
+}
+
+function printuser($id) {
+ global $sess,$change,$lang_saved,$lang_title,$lang_group,$lang_username,$lang_password,$lang_change,$lang_quota,$lang_groupmember,$lang_noprefaccess,$lang_disableuser, $lang_userlang, $lang_maxsessions, $lang_attach_file;
+ global $lang_flush_sessions_alt, $lang_flushed, $lang_deleteuser, $lang_email, $lang_notification, $default, $flush;
+
+ if($change == 1) print("$lang_saved
");
+
+ if ($flush == 1) {
+ flushsessions($id, $sess);
+ print($lang_flushed);
+ }
+
+ $sql = new Owl_DB;
+ $sql->query("select id,name from $default->owl_groups_table order by name");
+ $i=0;
+ while($sql->next_record()) {
+ $groups[$i][0] = $sql->f("id");
+ $groups[$i][1] = $sql->f("name");
+ $i++;
+ }
+ $sql->query("select * from $default->owl_users_table where id = '$id'");
+ while($sql->next_record()) {
+ print("");
+ }
+}
+
+function flushsessions($id, $sess) {
+ global $default;
+ $sql= new Owl_DB;
+ $sql->query("delete from $default->owl_sessions_table where uid='$id' AND sessid!='$sess'");
+}
+
+
+function printgroup($id) {
+ global $sess,$change,$lang_title,$lang_change,$lang_deletegroup,$lang_saved,$default;
+ if(isset($change)) print("$lang_saved
");
+ $sql = new Owl_DB;
+ $sql->query("select id,name from $default->owl_groups_table where id = '$id'");
+ while($sql->next_record()) {
+ print("");
+ }
+}
+
+function printnewgroup() {
+ global $default, $sess,$lang_title,$lang_add;
+ print("");
+}
+
+function printnewuser() {
+ global $sess,$lang_title,$lang_username,$lang_group,$lang_password,$lang_add,$default, $lang_quota,$lang_groupmember;
+ global $lang_email, $lang_notification, $lang_noprefaccess, $lang_disableuser, $lang_userlang, $lang_maxsessions, $lang_attach_file;
+ $sql = new Owl_DB;
+ $sql->query("select id,name from $default->owl_groups_table order by name");
+ $i=0;
+ while($sql->next_record()) {
+ $groups[$i][0] = $sql->f("id");
+ $groups[$i][1] = $sql->f("name");
+ $i++;
+ }
+ print("");
+}
+
+function printhtml() {
+ global $default, $sess, $lang_add, $lang_change, $change, $lang_saved;
+ global $lang_ht_tbl_border_sz, $lang_ht_tbl_hd_bg, $lang_ht_tbl_cell_bg_cl, $lang_ht_tbl_cell_bg_al, $lang_ht_tbl_bg_cl, $lang_ht_expand_width, $lang_ht_collapse_width, $lang_ht_bd_bg_cl, $lang_ht_bd_txt_cl, $lang_ht_bd_lnk_cl, $lang_ht_bd_vlnk_cl, $lang_ht_bd_width;
+ if(isset($change)) print("$lang_saved
");
+ print("");
+}
+
+function printprefs() {
+ global $default, $sess, $lang_add, $lang_change, $change, $lang_saved;
+ global $lang_owl_title_email, $lang_owl_email_from, $lang_owl_email_fromname, $lang_owl_email_replyto , $lang_owl_email_server, $lang_owl_title_HD, $lang_owl_lookAtHD, $lang_owl_def_file_security, $lang_owl_def_file_group_owner, $lang_owl_def_file_owner, $lang_owl_def_file_title, $lang_owl_def_file_meta , $lang_owl_def_fold_sec, $lang_owl_def_fold_group_owner, $lang_owl_def_fold_owner, $lang_owl_title_other, $lang_owl_max_filesize, $lang_owl_owl_timeout, $lang_owl_owl_expand, $lang_owl_version_control, $lang_owl_restrict_view ;
+ global $lang_owl_title_tools, $lang_owl_dbdump_path,$lang_owl_gzip_path, $lang_owl_tar_path;
+
+ if(isset($change)) print("$lang_saved
");
+ print("");
+}
+
+function dobackup() {
+ global $default;
+
+ $command = $default->dbdump_path . " --opt --host=" . $default->owl_db_host . " --user=" . $default->owl_db_user . " --password=" . $default->owl_db_pass . " " . $default->owl_db_name . " | " . $default->gzip_path . " -fc";
+ $date = date("Ymd.Hms");
+
+ header("Content-Disposition: attachment; filename=\"" . $default->owl_db_name . "-$date.sql.gz\"");
+ header("Content-Location: " . $default->owl_db_name . "-$date.sql.gz");
+ header("Content-Type: application/octet-stream");
+ //header("Content-Length: $fsize");
+ //header("Pragma: no-cache");
+ header("Expires: 0");
+ passthru($command);
+ exit();
+
+}
+
+
+
+if($action) {
+ print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
+ print("| ");
+ print(" |
");
+ print("| ");
+ print uid_to_name($userid);
+ print(" : $lang_logout | ");
+ print(" $lang_owl_admin | ");
+ print(" | ");
+ print("
");
+ print("
");
+ print("
table_expand_width>
");
+ print("table_expand_width BORDER=$default->table_border>");
+ print("table_border>");
+ print(" ");
+ print(" ");
+ print(" ");
+ print(" ");
+ if (file_exists($default->dbdump_path) && file_exists($default->gzip_path)) {
+ print("
");
+ }
+ else {
+ print("
");
+ }
+// print("$lang_upg_MD5
");
+ printusers();
+ print("
");
+ printgroups();
+ print(" | ");
+ print(" | ");
+ if(isset($owluser)) printuser($owluser);
+ if(isset($group)) printgroup($group);
+ if($action == "newgroup") printnewgroup();
+ if($action == "newuser") printnewuser();
+ if($action == "edhtml") printhtml();
+ if($action == "edprefs") printprefs();
+ print(" |
");
+} else {
+ exit("$lang_err_general");
+}
+
+print("
table_expand_width>
");
+?>
+
+