Commit cd4b9a42 authored by lrargerich's avatar lrargerich

Many improvements

parent aaf2db2e
## THIS FILE IS JUST A HELP FOR DEVELOPERS IT SHOULDNT BE USED IN A 1.5 DISTRIBUTION
alter table users_permissions add level varchar(80);
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_userfiles','user','Can upload personal files','registered);
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_tasks','user','Can use tasks','registered);
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_notepad','user','Can use the notepad','registered);
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_newsreader','user','Can use the newsreader','registered);
drop table if exists tiki_userfiles;
create table tiki_userfiles(
......@@ -11,6 +17,7 @@ create table tiki_userfiles(
data longblob,
hits integer(8),
isFile char(1),
path varchar(255),
created integer(14),
primary key(fileId)
);
......@@ -77,9 +84,9 @@ create table tiki_user_tasks(
### Inter-user messages
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_messages','messu','Can use the messaging system');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_broadcast','messu','Can broadcast messages to groups');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_broadcast_all','messu','Can broadcast messages to all user');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_messages','messu','Can use the messaging system','registered');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_broadcast','messu','Can broadcast messages to groups','editor');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_broadcast_all','messu','Can broadcast messages to all user','admin');
drop table if exists messu_messages;
create table messu_messages(
......@@ -137,13 +144,15 @@ alter table tiki_pages add cache_timestamp integer(14);
### DIRECTORIES BEGIN
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_admin_directory','directory','Can admin the directory');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_view_directory','directory','Can use the directory');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_admin_directory_cats','directory','Can admin directory categories');
REPLACE INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_admin_directory_sites','directory','Can admin directory sites');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_submit_link','directory','Can submit sites to the directory');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_autosubmit_link','directory','Submited links are valid');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_validate_links','directory','Can validate submited links');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_admin_directory','directory','Can admin the directory','editor');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_view_directory','directory','Can use the directory','basic');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_admin_directory_cats','directory','Can admin directory categories','editor');
REPLACE INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_admin_directory_sites','directory','Can admin directory sites','editor');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_submit_link','directory','Can submit sites to the directory','basic');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_autosubmit_link','directory','Submited links are valid','editor');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_validate_links','directory','Can validate submited links','editor');
drop table if exists tiki_directory_categories;
......@@ -312,7 +321,7 @@ create fulltext index ft on tiki_blog_posts (data);
### FULLTEXT SEARCH END
alter table users_permissions add level varchar(80);
## LEVELS
## 1-anonymous users
## 2-registered users
......
......@@ -10,14 +10,19 @@ class UserFilesLib extends TikiLib {
$this->db = $db;
}
function upload_userfile($user,$name,$filename,$filetype,$filesize,$data)
function userfiles_quota($user)
{
return $this->getOne("select sum(filesize) from tiki_userfiles where user='$user'");
}
function upload_userfile($user,$name,$filename,$filetype,$filesize,$data,$path)
{
$name = addslashes($name);
$filename = addslashes($filename);
$data = addslashes($data);
$now = date("U");
$query = "insert into tiki_userfiles(user,name,filename,filetype,filesize,data,created,hits)
values('$user','$name','$filename','$filetype','$filesize','$data',$now,0)";
$query = "insert into tiki_userfiles(user,name,filename,filetype,filesize,data,created,hits,path)
values('$user','$name','$filename','$filetype','$filesize','$data',$now,0,'$path')";
$this->query($query);
}
......@@ -55,8 +60,13 @@ class UserFilesLib extends TikiLib {
function remove_userfile($user,$fileId)
{
$query = "delete from tiki_userfiles where user='$user' and fileId=$fileId";
$this->query($query);
global $uf_use_dir;
$path = $this->getOne("select path from tiki_userfiles where user='$user' and fileId=$fileId");
if($path) {
@unlink($uf_use_dir.$path);
}
$query = "delete from tiki_userfiles where user='$user' and fileId=$fileId";
$this->query($query);
}
}
......
<?php
if($user && $feature_tasks == 'y') {
if($user && $feature_tasks == 'y' && $tiki_p_tasks == 'y') {
if(isset($_SESSION['thedate'])) {
$pdate = $_SESSION['thedate'];
} else {
......
......@@ -14,7 +14,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<a name="features"></a>
<div class="cbox">
......@@ -115,7 +116,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}General preferences and settings{/tr}</div>
......@@ -248,7 +250,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}User registration and login{/tr}</div>
......@@ -321,7 +324,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}Wiki settings{/tr}</div>
......@@ -520,7 +524,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}Image galleries{/tr}</div>
......@@ -596,7 +601,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}File galleries{/tr}</div>
......@@ -669,7 +675,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}CMS settings{/tr}</div>
......@@ -733,7 +740,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}Poll settings{/tr}</div>
......@@ -774,7 +782,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}Blog settings{/tr}</div>
......@@ -856,7 +865,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}Forums{/tr}</div>
......@@ -918,7 +928,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}FAQs settings{/tr}</div>
......@@ -962,7 +973,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}Trackers{/tr}</div>
......@@ -993,7 +1005,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<a name="webmail"></a>
<div class="cbox">
......@@ -1033,7 +1046,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<a name="directory"></a>
<div class="cbox">
......@@ -1069,6 +1083,41 @@
</div>
</div>
[ <a href="#features" class="link">{tr}feat{/tr}</a> |
<a href="#general" class="link">{tr}gral{/tr}</a> |
<a href="#login" class="link">{tr}login{/tr}</a> |
<a href="#wiki" class="link">{tr}wiki{/tr}</a> |
<a href="#gal" class="link">{tr}img gls{/tr}</a> |
<a href="#fgal" class="link">{tr}file gls{/tr}</a> |
<a href="#blogs" class="link">{tr}blogs{/tr}</a> |
<a href="#forums" class="link">{tr}frms{/tr}</a> |
<a href="#polls" class="link">{tr}polls{/tr}</a> |
<a href="#rss" class="link">{tr}rss{/tr}</a> |
<a href="#cms" class="link">{tr}cms{/tr}</a> |
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<a name="userfiles"></a>
<div class="cbox">
<div class="cbox-title">{tr}User files{/tr}</div>
<div class="cbox-data">
<div class="simplebox">
<form action="tiki-admin.php" method="post">
<table width="100%">
<tr><td class="form">{tr}Quota (Mb){/tr}</td><td>
<input type="text" name="userfiles_quota" value="{$userfiles_quota}" />
</td></tr>
<tr><td class="form">{tr}Use database to store userfiles{/tr}:</td><td><input type="radio" name="uf_use_db" value="y" {if $uf_use_db eq 'y'}checked="checked"{/if}/></td></tr>
<tr><td class="form">{tr}Use a directory to store userfiles{/tr}:</td><td><input type="radio" name="uf_use_db" value="n" {if $uf_use_db eq 'n'}checked="checked"{/if}/> {tr}Path{/tr}:<input type="text" name="uf_use_dir" value="{$uf_use_dir}" /> </tr>
<tr><td align="center" colspan="2"><input type="submit" name="userfilesprefs" value="{tr}Change preferences{/tr}" /></td></tr> </table>
</form>
</div>
</div>
</div>
</div>
<a name="rss"></a>
......@@ -1086,7 +1135,8 @@
<a href="#faqs" class="link">{tr}FAQs{/tr}</a> |
<a href="#trackers" class="link">{tr}trckrs{/tr}</a> |
<a href="#webmail" class="link">{tr}webmail{/tr}</a>|
<a href="#directory" class="link">{tr}directory{/tr}</a>
<a href="#directory" class="link">{tr}directory{/tr}|
<a href="#userfiles" class="link">{tr}userfiles{/tr}</a>
]
<div class="cbox">
<div class="cbox-title">{tr}RSS feeds{/tr}</div>
......
......@@ -14,11 +14,14 @@
<form method="get" action="tiki-assignpermission.php">
<input type="hidden" name="group" value="{$group}" />
<input type="hidden" name="type" value="{$type}" />
{tr}Create level:{/tr}<input type="text" name="level" /><input type="submit" name="createlevel" value="{tr}create{/tr}" />
</form>
<br/>
<br/>
<form method="get" action="tiki-assignpermission.php">
<input type="hidden" name="group" value="{$group}" />
<input type="hidden" name="type" value="{$type}" />
<select name="oper">
<option value="assign">{tr}assign{/tr}</option>
<option value="remove">{tr}remove{/tr}</option>
......@@ -48,6 +51,7 @@
<form name="tiki-assignpermission.php" method="get">
<input type="hidden" name="group" value="{$group}" />
<input type="hidden" name="type" value="{$type}" />
<input type="submit" name="update" value="{tr}update{/tr}" />
<table class="normal">
<tr>
......@@ -88,7 +92,7 @@
<td class="heading">&nbsp;</td>
<td class="heading"><a class="tableheading" href="tiki-assignpermission.php?type={$type}&amp;group={$group}&amp;offset={$offset}&amp;sort_mode={if $sort_mode eq 'permName_desc'}permName_asc{else}permName_desc{/if}">{tr}name{/tr}</a></td>
<td class="heading">{tr}level{/tr}</td>
<td class="heading">{tr}assgn{/tr}</td>
<!--<td class="heading">{tr}assgn{/tr}</td>-->
<td class="heading"><a class="tableheading" href="tiki-assignpermission.php?type={$type}&amp;group={$group}&amp;offset={$offset}&amp;sort_mode={if $sort_mode eq 'type_desc'}type_asc{else}type_desc{/if}">{tr}type{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-assignpermission.php?type={$type}&amp;group={$group}&amp;offset={$offset}&amp;sort_mode={if $sort_mode eq 'groupDesc_desc'}permDesc_asc{else}permDesc_desc{/if}">{tr}desc{/tr}</a></td>
<!-- <td class="heading">{tr}action{/tr}</td> -->
......@@ -100,7 +104,7 @@
<td class="odd"><input type="checkbox" name="perm[{$perms[user].permName}]" {if $perms[user].hasPerm eq 'y'}checked="checked"{/if}/></td>
<td class="odd">{$perms[user].permName}</td>
<td class="odd"><select name="level[{$perms[user].permName}]"><select name="level">{html_options output=$levels values=$levels selected=$perms[user].level}</select></td>
<td class="odd">{$perms[user].hasPerm}</td>
<!--<td class="odd">{$perms[user].hasPerm}</td>-->
<td class="odd">{$perms[user].type}</td>
<td class="odd">{$perms[user].permDesc}</td>
<!--
......@@ -117,7 +121,7 @@
<td class="even"><input type="checkbox" name="perm[{$perms[user].permName}]" {if $perms[user].hasPerm eq 'y'}checked="checked"{/if}/></td>
<td class="even">{$perms[user].permName}</td>
<td class="even"><select name="level[{$perms[user].permName}]">{html_options output=$levels values=$levels selected=$perms[user].level}</select></td>
<td class="even">{$perms[user].hasPerm}</td>
<!--<td class="even">{$perms[user].hasPerm}</td>-->
<td class="even">{$perms[user].type}</td>
<td class="even">{$perms[user].permDesc}</td>
<!--
......
......@@ -19,7 +19,7 @@
</a></td>
{/if}
{if $feature_tasks eq 'y'}
{if $feature_tasks eq 'y' and $tiki_p_tasks eq 'y'}
<td valign="top"><a class="link" href="tiki-user_tasks.php">
<img width="48" height="48" border="0" src="img/mytiki/tasks.gif" alt="{tr}Tasks{/tr}" /><br/>
<div align="center"><small>{tr}Tasks{/tr}</small></div>
......@@ -27,7 +27,7 @@
{/if}
{if $feature_user_bookmarks eq 'y'}
{if $feature_user_bookmarks eq 'y' and $tiki_p_create_bookmarks eq 'y'}
<td valign="top"><a class="link" href="tiki-user_bookmarks.php">
<img width="48" height="48" border="0" src="img/mytiki/bookmarks.gif" alt="{tr}Bookmarks{/tr}" /><br/>
<div align="center"><small>{tr}Bookmarks{/tr}</small></div>
......@@ -36,7 +36,7 @@
{if $user_assigned_modules eq 'y'}
{if $user_assigned_modules eq 'y' and $tiki_p_configure_modules eq 'y'}
<td valign="top"><a class="link" href="tiki-user_assigned_modules.php">
<img width="48" height="48" border="0" src="img/mytiki/modules.gif" alt="{tr}Modules{/tr}" /><br/>
<div align="center"><small>{tr}Modules{/tr}</small></div>
......@@ -44,28 +44,28 @@
{/if}
{if $feature_newsreader eq 'y'}
{if $feature_newsreader eq 'y' and $tiki_p_newsreader eq 'y'}
<td valign="top"><a class="link" href="tiki-newsreader_servers.php">
<img width="48" height="48" border="0" src="img/mytiki/news.gif" alt="{tr}Newsreader{/tr}" /><br/>
<div align="center"><small>{tr}Newsreader{/tr}</small></div>
</a></td>
{/if}
{if $feature_webmail eq 'y'}
{if $feature_webmail eq 'y' and $tiki_p_use_webmail eq 'y'}
<td valign="top"><a class="link" href="tiki-webmail.php">
<img width="48" height="48" border="0" src="img/mytiki/webmail.gif" alt="{tr}Webmail{/tr}" /><br/>
<div align="center"><small>{tr}Webmail{/tr}</small></div>
</a></td>
{/if}
{if $feature_notepad eq 'y'}
{if $feature_notepad eq 'y' and $tiki_p_notepad eq 'y'}
<td valign="top"><a class="link" href="tiki-notepad_list.php">
<img width="48" height="48" border="0" src="img/mytiki/notes.gif" alt="{tr}Notepad{/tr}" /><br/>
<div align="center"><small>{tr}Notepad{/tr}</small></div>
</a></td>
{/if}
{if $feature_userfiles eq 'y'}
{if $feature_userfiles eq 'y' and $tiki_p_userfiles eq 'y'}
<td valign="top"><a class="link" href="tiki-userfiles.php">
<img width="48" height="48" border="0" src="img/mytiki/myfiles.gif" alt="{tr}MyFiles{/tr}" /><br/>
<div align="center"><small>{tr}MyFiles{/tr}</small></div>
......
......@@ -4,6 +4,30 @@
<br/><br/>
<h3>{tr}User Files{/tr}</h3>
<div align="center">
<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>
<table border='0' height='20' cellpadding='0' cellspacing='0'
width='200' style='background-color:white;'>
<tr>
<td style='background-color:red;' width='{$cellsize}'>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
<td>
<small>{$percentage}%</small>
</td>
</tr>
<tr>
<td colspan='2'>
<small>{tr}quota{/tr}</small>
</td>
</tr>
</table>
</div>
<form action="tiki-userfiles.php" method="post">
<input type="submit" name="delete" value="{tr}delete{/tr}" />
<table class="normal">
......@@ -56,7 +80,7 @@
</tr>
-->
<tr>
<td class="formcolor">{tr}Upload file{/tr}:</td><td class="formcolor"><input type="hidden" name="MAX_FILE_SIZE" value="1000000000"><input size="16" name="userfile1" type="file"><input style="font-size:9px;" type="submit" name="upload" value="{tr}upload{/tr}" /></td>
<td class="formcolor">{tr}Upload file{/tr}:</td><td class="formcolor"><input type="hidden" name="MAX_FILE_SIZE" value="10000000000000"><input size="16" name="userfile1" type="file"><input style="font-size:9px;" type="submit" name="upload" value="{tr}upload{/tr}" /></td>
</tr>
</table>
</form>
......
......@@ -30,6 +30,15 @@ if(isset($_REQUEST["layout_ss"])) {
}
if(isset($_REQUEST["userfilesprefs"])) {
$tikilib->set_preference("uf_use_db",$_REQUEST["uf_use_db"]);
$tikilib->set_preference("uf_use_dir",$_REQUEST["uf_use_dir"]);
$tikilib->set_preference("userfiles_quota",$_REQUEST["userfiles_quota"]);
$smarty->assign('uf_use_db',$_REQUEST["uf_use_db"]);
$smarty->assign('uf_use_dir',$_REQUEST["uf_use_dir"]);
$smarty->assign('userfiles_quota',$_REQUEST['userfiles_quota']);
}
if(isset($_REQUEST["layout"])) {
if(isset($_REQUEST["feature_left_column"]) && $_REQUEST["feature_left_column"]=="on") {
$tikilib->set_preference("feature_left_column",'y');
......
......@@ -74,7 +74,7 @@ if(isset($_REQUEST["find"])) {
$smarty->assign('find',$find);
if(!isset($_REQUEST["type"])) {
$_REQUEST["type"]='';
$_REQUEST["type"]='tiki';
}
$smarty->assign('type',$_REQUEST["type"]);
......
......@@ -7,13 +7,19 @@ include_once('lib/userfiles/userfileslib.php');
if(!isset($_REQUEST["fileId"])) {
die;
}
$uf_use_db=$tikilib->get_preference('uf_use_db','y');
$uf_use_dir=$tikilib->get_preference('uf_use_dir','');
$info = $userfileslib->get_userfile($user,$_REQUEST["fileId"]);
$type=&$info["filetype"];
$file=&$info["filename"];
$content=&$info["data"];
header("Content-type: $type");
header( "Content-Disposition: inline; filename=$file" );
echo "$content";
if($info["path"]) {
readfile($uf_use_dir.$info["path"]);
} else {
echo "$content";
}
?>
\ No newline at end of file
......@@ -13,6 +13,12 @@ if($feature_newsreader != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if($tiki_p_newsreader != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if(!isset($_REQUEST["serverId"])) {
......
......@@ -13,7 +13,14 @@ if($feature_newsreader != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
}
if($tiki_p_newsreader != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if((!isset($_REQUEST['server']))||(!isset($_REQUEST['port']))||(!isset($_REQUEST['username']))
||(!isset($_REQUEST['password']))||(!isset($_REQUEST['group']))) {
......
......@@ -15,6 +15,13 @@ if($feature_newsreader != 'y') {
die;
}
if($tiki_p_newsreader != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if((!isset($_REQUEST['id']))||(!isset($_REQUEST['server']))||(!isset($_REQUEST['port']))||(!isset($_REQUEST['username']))
||(!isset($_REQUEST['password']))||(!isset($_REQUEST['group']))) {
$smarty->assign('msg',tra("Missing information to read news (server,port,username,password,group) required"));
......
......@@ -15,6 +15,13 @@ if($feature_newsreader != 'y') {
die;
}
if($tiki_p_newsreader != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if(!isset($_REQUEST["serverId"])) $_REQUEST["serverId"]=0;
......
......@@ -14,6 +14,13 @@ if(!$user) {
die;
}
if($tiki_p_notepad != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if(isset($_REQUEST["delete"])) {
......
......@@ -14,6 +14,11 @@ if(!$user) {
die;
}
if($tiki_p_notepad != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if(!isset($_REQUEST["noteId"])) {
......
......@@ -14,6 +14,12 @@ if(!$user) {
die;
}
if($tiki_p_notepad != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
if(!isset($_REQUEST["noteId"])) $_REQUEST["noteId"]=0;
......
......@@ -306,6 +306,13 @@ $feature_custom_home = 'n';
$w_use_db = 'y';
$w_use_dir = '';
$uf_use_db = 'y';
$uf_use_dir = '';
$smarty->assign('uf_use_db',$uf_use_db);
$smarty->assign('uf_use_dir',$uf_use_dir);
$userfiles_quota = 30;
$smarty->assign('userfiles_quota',$userfiles_quota);
$feature_wiki_attachments = 'n';
$feature_page_title = 'y';
......
......@@ -14,6 +14,13 @@ if(!$user) {
die;
}
if($tiki_p_tasks != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
$comp_array = Array();
$comp_array_p = Array();
......
......@@ -14,22 +14,61 @@ if(!$user) {
die;
}
if($tiki_p_userfiles != 'y') {
$smarty->assign('msg',tra("Permission denied to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
$quota = $userfileslib->userfiles_quota($user);
$limit = $userfiles_quota * 1024 * 1000;
if($limit==0) $limit=999999999;
$percentage = $quota/$limit*100;
$cellsize = round($percentage/100*200);
$percentage = round($percentage);
$smarty->assign('cellsize',$cellsize);
$smarty->assign('percentage',$percentage);
// Process upload here
if(isset($_FILES['userfile1'])&&is_uploaded_file($_FILES['userfile1']['tmp_name'])) {
$fp = fopen($_FILES['userfile1']['tmp_name'],"rb");
$data = '';
while(!feof($fp)) {
$data .= fread($fp,8192*16);
$fp = fopen($_FILES['userfile1']['tmp_name'],"rb");
$data = '';
$fhash='';
if($uf_use_db == 'n') {
$fhash = md5($name = $_FILES['userfile1']['name']);
$fw = fopen($uf_use_dir.$fhash,"w");
if(!$fw) {
$smarty->assign('msg',tra('Cannot write to this file:').$fhash);
$smarty->display("styles/$style_base/error.tpl");
die;
}
}
while(!feof($fp)) {
if($uf_use_db == 'y') {
$data .= fread($fp,8192*16);
} else {
$data = fread($fp,8192*16);
fwrite($fw,$data);
}
}
fclose($fp);
if($uf_use_db == 'n') {
fclose($fw);
$data='';
}
$size = $_FILES['userfile1']['size'];
$name = $_FILES['userfile1']['name'];
$type = $_FILES['userfile1']['type'];
$userfileslib->upload_userfile($user,'',$name,$type,$size, $data);
if($quota + $size > $limit) {
$smarty->assign('msg',tra('Cannot upload this file not enough quota'));
$smarty->display("styles/$style_base/error.tpl");
die;
}
$userfileslib->upload_userfile($user,'',$name,$type,$size, $data, $fhash);