Fixing PHP warning.

1.10.x
Julio Montoya 13 years ago
parent 9217932e51
commit 849a89ee25
  1. 164
      main/document/create_audio.php
  2. 2
      main/document/create_document.php
  3. 2
      main/document/create_draw.php
  4. 2
      main/document/create_paint.php
  5. 2
      main/document/edit_document.php
  6. 20
      main/document/edit_draw.php
  7. 24
      main/document/edit_paint.php
  8. 2
      main/document/record_audio.php
  9. 2
      main/document/record_audio_wami.php
  10. 2
      main/document/webcam_clip.php
  11. 5
      main/inc/lib/groupmanager.lib.php

@ -34,7 +34,7 @@ if (api_get_setting('enabled_text2audio') == 'false'){
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id());
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -89,7 +89,7 @@ $interbreadcrumb[] = array(
"name" => get_lang('Documents')
);
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(
api_get_user_id(),
Security::remove_XSS($dir),
api_get_session_id()
@ -114,7 +114,7 @@ if (isset ($group)) {
// Copied from document.php
$dir_array = explode('/', $dir);
$array_len = count($dir_array);
$dir_acum = '';
for ($i = 0; $i < $array_len; $i++) {
$url_dir = 'document.php?&curdirpath='.$dir_acum.$dir_array[$i];
@ -132,12 +132,12 @@ Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&amp;id='.$document_id.'&amp;dt2a=google">'.Display::return_icon('google.png',get_lang('GoogleAudio'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&amp;id='.$document_id.'&amp;dt2a=pediaphon">'.Display::return_icon('pediaphon.png', get_lang('Pediaphon'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
?>
@ -153,11 +153,11 @@ $(document).ready(function(){
'displayFormat' : '#input/#max'
};
$('#textarea_google').textareaCount(options, function(data){
$('#textareaCallBack').html(data);
});
$('#textareaCallBack').html(data);
});
});
</script>
</script>
<style>
.overview {
background: #FFEC9D;
@ -175,7 +175,7 @@ $(document).ready(function(){
.warningTextareaInfo {
color: #FF0000;
font-weight:bold;
text-align: right;
text-align: right;
}
#showData {
@ -188,36 +188,36 @@ $(document).ready(function(){
</style>
<div id="textareaCallBack"></div>
<?php
if(Security::remove_XSS($_POST['text2voice_mode'])=='google'){
if(Security::remove_XSS($_POST['text2voice_mode'])=='google'){
downloadMP3_google($filepath, $dir);
} elseif (Security::remove_XSS($_POST['text2voice_mode']) == 'pediaphon') {
downloadMP3_pediaphon($filepath, $dir);
}
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql_select = "SELECT * FROM $tbl_admin_languages";
$result_select = Database::query($sql_select);
$result_select = Database::query($sql_select);
$options = $options_pedia = array();
$selected_language = null;
$options_pedia['defaultmessage'] = get_lang('FirstSelectALanguage'); //need read before platform languages
while ($row = Database::fetch_array($result_select)) {
if (api_get_setting('platformLanguage')==$row['english_name']) {
while ($row = Database::fetch_array($result_select)) {
if (api_get_setting('platformLanguage')==$row['english_name']) {
//$selected_language = $row['isocode'];//lang default is the default platform language
}
$options[$row['isocode']] =$row['original_name'].' ('.$row['english_name'].')';
if (in_array($row['isocode'], array('de', 'en', 'es', 'fr'))){
if (in_array($row['isocode'], array('de', 'en', 'es', 'fr'))){
$options_pedia[$row['isocode']] =$row['original_name'].' ('.$row['english_name'].')';
}
}
}
$icon = Display::return_icon('text2audio.png', get_lang('HelpText2Audio'),'',ICON_SIZE_MEDIUM);
echo '<div class="page-header"><h2>'.$icon.get_lang('HelpText2Audio').'</h2></div>';
echo '<div class="page-header"><h2>'.$icon.get_lang('HelpText2Audio').'</h2></div>';
if(Security::remove_XSS($_GET['dt2a'])=='google'){
$selected_language = api_get_language_isocode();//lang default is the course language
echo '<div>';
@ -225,56 +225,56 @@ $(document).ready(function(){
$form->addElement('hidden', 'text2voice_mode', 'google');
$form->addElement('hidden', 'document_id', $document_id);
$form->addElement('text', 'title', get_lang('Title'));
$form->addElement('select', 'lang', get_lang('Language'), $options);
$form->addElement('select', 'lang', get_lang('Language'), $options);
$form->addElement('textarea', 'text', get_lang('InsertText2Audio'), array('id' => 'textarea_google', 'class' =>'span6' ));
//echo Display :: return_icon('info3.gif', get_lang('HelpGoogleAudio'), array('align' => 'absmiddle', 'hspace' => '3px'), false);
$form->addElement('style_submit_button', 'submit', get_lang('SaveMP3'), 'class="save"');
$defaults = array();
$defaults['lang'] = $selected_language;
$form->setDefaults($defaults);
$defaults['lang'] = $selected_language;
$form->setDefaults($defaults);
$form->display();
echo '</div>';
}
if(Security::remove_XSS($_GET['dt2a'])=='pediaphon'){
//lang default is a default message
$selected_language = "defaultmessage";
$options['defaultmessage'] =get_lang('FirstSelectALanguage');
$options['defaultmessage'] =get_lang('FirstSelectALanguage');
echo '<div>';
$form = new FormValidator('form2', 'post', null, '', array('id' => 'form2'));
$form->addElement('hidden', 'text2voice_mode','pediaphon');
$form->addElement('hidden', 'document_id', $document_id);
$form->addElement('text', 'title', get_lang('Title'));
$form->addElement('select', 'lang', get_lang('Language'), $options_pedia, array('onclick' => 'update_voices(this.selectedIndex);'));
$form->addElement('select', 'voices', get_lang('Voice'), array(get_lang('FirstSelectALanguage')), array());
$form->addElement('select', 'voices', get_lang('Voice'), array(get_lang('FirstSelectALanguage')), array());
$speed_options = array();
$speed_options['1'] = get_lang('Normal');
$speed_options['0.75'] = get_lang('GoFaster');
$speed_options['0.8'] = get_lang('Fast');
$speed_options['1.2'] = get_lang('Slow');
$speed_options['1.6'] = get_lang('SlowDown');
$form->addElement('select', 'speed', get_lang('Speed'), $speed_options, array());
$form->addElement('select', 'speed', get_lang('Speed'), $speed_options, array());
$form->addElement('textarea', 'text', get_lang('InsertText2Audio'), array('id' => 'textarea_pediaphon', 'class' =>'span6'));
//echo Display :: return_icon('info3.gif', get_lang('HelpPediaphon'), array('align' => 'absmiddle', 'hspace' => '3px'), false);
$form->addElement('style_submit_button', 'submit', get_lang('SaveMP3'), 'class="save"');
$defaults = array();
$defaults['lang'] = $selected_language;
$form->setDefaults($defaults);
$defaults['lang'] = $selected_language;
$form->setDefaults($defaults);
$form->display();
echo '</div>';
?>
<!-- javascript form name form2 update voices -->
<script>
var langslist=document.form2.lang
var voiceslist=document.form2.voices
var voiceslist=document.form2.voices
var voices = new Array();
voices[0] = ["<?php echo get_lang('FirstSelectALanguage'); ?>"]
// German
@ -287,7 +287,7 @@ $(document).ready(function(){
).' (de6)'; ?>|de6", "<?php echo get_lang('Female').' (de7)'; ?>|de7", "<?php echo get_lang(
'Female'
).' (de8 HQ)'; ?>|de8"]
// English
voices[2] = ["<?php echo get_lang('Male').' (en1)'; ?>|en1", "<?php echo get_lang(
'Male'
@ -296,48 +296,48 @@ $(document).ready(function(){
).' (us2)'; ?>|us2", "<?php echo get_lang('Male').' (us3)'; ?>|us3", "<?php echo get_lang(
'Female'
).'(us4 HQ)'; ?>|us4"]
//Spanish
voices[3]=["<?php echo get_lang('Male').' (es5 HQ)'; ?>|es5"]
//French
voices[4]=["<?php echo get_lang('Female').' (fr8 HQ)'; ?>|fr8"]
function update_voices(selectedvoicegroup){
voiceslist.options.length=0
for (i=0; i<voices[selectedvoicegroup].length; i++)
voiceslist.options[voiceslist.options.length]=new Option(voices[selectedvoicegroup][i].split("|")[0], voices[selectedvoicegroup][i].split("|")[1])
}
</script>
</script>
<?php
}
//end pediaphon
//vozMe services
//disabled for a time
/*
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checktext2voice" onclick="javascript: if(this.checked){document.getElementById(\'option3\').style.display=\'block\';}else{document.getElementById(\'option3\').style.display=\'none\';}"/>&nbsp;<img src="../img/file_sound.gif" title="'.get_lang('HelpvozMe').'" alt="'.get_lang('vozMe').'"/>&nbsp;'.get_lang('vozMe').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error3" style="display:none;color:red"></span>';
echo '<div id="option3" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
echo '<form id="form3" name="form3" method="post" action="http://vozme.com/text2voice.php" target="mymp3" class="formw">';
echo '<br/>';
echo '<label>'.get_lang('Language').': ';
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql_select = "SELECT * FROM $tbl_admin_languages";
$result_select = Database::query($sql_select);
$result_select = Database::query($sql_select);
echo '<select name="lang" id="select">';
while ($row = Database::fetch_array($result_select)) {
if (in_array($row['isocode'], array('ca', 'en', 'es', 'hi', 'it', 'pt'))){
if (api_get_setting('platformLanguage')==$row['english_name']){
echo '<option value="'.$row['isocode'].'" selected="selected">'.$row['original_name'].' ('.$row['english_name'].')</option>';
}
else{
else{
echo '<option value="'.$row['isocode'].'">'.$row['original_name'].' ('.$row['english_name'].')</option>';
}
}
@ -355,8 +355,8 @@ $(document).ready(function(){
echo '<br/>';
echo '<label>';
echo '<textarea name="text" id="textarea" cols="70" rows="10"></textarea>';
echo '</label>';
echo '<br/><br/>';
echo '</label>';
echo '<br/><br/>';
echo '<button class="save" type="submit" name="SendText2Audio">'.get_lang('BuildMP3').'</button>';
echo '<br/>';
echo '</form>';
@ -383,30 +383,30 @@ function downloadMP3_google($filepath, $dir)
//security
if (!isset($_POST['lang']) && !isset($_POST['text']) && !isset($_POST['title']) && !isset($filepath) && !isset($dir)) {
echo '<script>window.location.href="'.$location.'"</script>';
return;
return;
}
global $_user;
$_course = api_get_course_info();
$clean_title=trim($_POST['title']);
$clean_text=trim($_POST['text']);
if(empty($clean_title) || empty($clean_text)){
if(empty($clean_title) || empty($clean_text)){
echo '<script>window.location.href="'.$location.'"</script>';
return;
}
$clean_title=Security::remove_XSS($clean_title);
$clean_title=Database::escape_string($clean_title);
$clean_title=Database::escape_string($clean_title);
$clean_title=str_replace(' ','_', $clean_title);//compound file names
$clean_text=Security::remove_XSS($clean_text);
$clean_lang=Security::remove_XSS($_POST['lang']);
$clean_lang=Security::remove_XSS($_POST['lang']);
$extension='mp3';
$audio_filename=$clean_title.'.'.$extension;
$audio_filename=$clean_title.'.'.$extension;
$audio_title = str_replace('_',' ',$clean_title);
//prevent duplicates
if (file_exists($filepath.'/'.$clean_title.'.'.$extension)){
$i = 1;
if (file_exists($filepath.'/'.$clean_title.'.'.$extension)){
$i = 1;
while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) {
$i++;
}
@ -416,8 +416,8 @@ function downloadMP3_google($filepath, $dir)
}
$documentPath = $filepath.'/'.$audio_filename;
//prev for a fine unicode, borrowed from main api TODO:clean
// Safe replacements for some non-letter characters (whitout blank spaces)
$search = array(
@ -499,7 +499,7 @@ function downloadMP3_google($filepath, $dir)
}
//erase temporal file
unlink($tmpfname);
//adding the file
//add new file to disk
file_put_contents($documentPath, $returntext2voice);
@ -548,7 +548,7 @@ function downloadMP3_pediaphon($filepath, $dir)
//security
if(!isset($_POST['lang']) && !isset($_POST['text']) && !isset($_POST['title']) && !isset($filepath) && !isset($dir)) {
echo '<script>window.location.href="'.$location.'"</script>';
return;
return;
}
global $_user;
$_course = api_get_course_info();
@ -561,19 +561,19 @@ function downloadMP3_pediaphon($filepath, $dir)
return;
}
$clean_title=Security::remove_XSS($clean_title);
$clean_title=Database::escape_string($clean_title);
$clean_title=Database::escape_string($clean_title);
$clean_title=str_replace(' ','_', $clean_title);//compound file names
$clean_text=Security::remove_XSS($clean_text);
$clean_lang=Security::remove_XSS($_POST['lang']);
$clean_speed=Security::remove_XSS($_POST['speed']);
$extension='mp3';
$audio_filename=$clean_title.'.'.$extension;
$audio_title = str_replace('_',' ',$clean_title);
//prevent duplicates
if (file_exists($filepath.'/'.$clean_title.'.'.$extension)){
$i = 1;
if (file_exists($filepath.'/'.$clean_title.'.'.$extension)){
$i = 1;
while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) {
$i++;
}
@ -583,7 +583,7 @@ function downloadMP3_pediaphon($filepath, $dir)
}
$documentPath = $filepath.'/'.$audio_filename;
@ -652,10 +652,10 @@ function downloadMP3_pediaphon($filepath, $dir)
$filename = api_transliterate($filename, 'x', $encoding);
// Replacing remaining dangerous non-letter characters.
$clean_text = str_replace($search, $replace, $filename);
//adding the file
if($clean_lang=='de'){
$url_pediaphon='http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice.cgi';
$find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/(.*)\.mp3\"/';
@ -673,12 +673,12 @@ function downloadMP3_pediaphon($filepath, $dir)
"Content-Length: " . strlen($data) . "\r\n",
'content' => $data
)
);
);
$context = stream_context_create($opts);
$previous_returntext2voice = file_get_contents($url_pediaphon,false,$context);
//clean file contents
$search_source=preg_match($find_t2v, $previous_returntext2voice, $hits);
$souce_end=substr($hits[0], 0,-1);
$returntext2voice = file_get_contents($souce_end);
@ -694,10 +694,10 @@ function downloadMP3_pediaphon($filepath, $dir)
}
//erase temporal file
unlink($tmpfname);
//save file
file_put_contents($documentPath, $returntext2voice);
//add document to database
$current_session_id = api_get_session_id();
$groupId=$_SESSION['_gid'];

@ -192,7 +192,7 @@ if (!$is_certificate_mode) {
} else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
}
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(
$_user['user_id'],
Security::remove_XSS($dir),
api_get_session_id()

@ -93,7 +93,7 @@ if (isset ($_SESSION['_gid']) && $_SESSION['_gid'] != 0) {
$interbreadcrumb[] = array ("url" => "./document.php?id=".$parent_id.$req_gid, "name" => get_lang('Documents'));
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir), api_get_session_id()))) {
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir), api_get_session_id()))) {
api_not_allowed(true);
}

@ -92,7 +92,7 @@ if (isset ($_SESSION['_gid']) && $_SESSION['_gid'] != 0) {
$interbreadcrumb[] = array ("url" => "./document.php?curdirpath=".urlencode($dir).$req_gid, "name" => get_lang('Documents'));
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir),api_get_session_id()))) {
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir),api_get_session_id()))) {
api_not_allowed(true);
}

@ -140,7 +140,7 @@ if ($is_certificate_mode) {
$html_editor_config['BaseHref'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir;
}
$is_allowed_to_edit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
$is_allowed_to_edit = api_is_allowed_to_edit(null, true) || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
$noPHP_SELF = true;
/* Other initialization code */

@ -31,7 +31,7 @@ $document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_c
if (empty($document_data)) {
api_not_allowed();
} else {
} else {
$document_id = $document_data['id'];
$file_path = $document_data['path'];
$dir = dirname($document_data['path']);
@ -106,7 +106,7 @@ else
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
} else {
foreach($document_data['parents'] as $document_sub_data) {
if ($document_data['title'] == $document_sub_data['title']) {
continue;
@ -115,7 +115,7 @@ if (empty($document_data['parents'])) {
}
}
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
if (!$is_allowedToEdit) {
api_not_allowed(true);
@ -125,23 +125,23 @@ event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editdraw">'.Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
if (api_browser_support('svg')) {
if (api_browser_support('svg')) {
//automatic loading the course language
$svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langsvgedit = api_get_language_isocode();
$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
$svg_url= api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit;
?>
<script type="text/javascript">
document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>');
function resizeIframe() {
var height = window.innerHeight -50;
@ -153,14 +153,14 @@ if (api_browser_support('svg')) {
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>
<?php
echo '<noscript>';
echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>';
echo '</noscript>';
} else {
} else {
Display::display_error_message(get_lang('BrowserDontSupportsSVG'));
}
Display::display_footer();

@ -31,7 +31,7 @@ $document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_c
if (empty($document_data)) {
api_not_allowed();
} else {
} else {
$document_id = $document_data['id'];
$file_path = $document_data['path'];
$dir = dirname($document_data['path']);
@ -91,11 +91,11 @@ if (!is_dir($filepath)) {
//groups //TODO:clean
if (isset ($_SESSION['_gid']) && $_SESSION['_gid'] != 0) {
$req_gid = '&amp;gidReq='.$_SESSION['_gid'];
$interbreadcrumb[] = array ('url' => '../group/group_space.php?gidReq='.$_SESSION['_gid'], 'name' => get_lang('GroupSpace'));
$group_document = true;
$noPHP_SELF = true;
$noPHP_SELF = true;
}
@ -109,7 +109,7 @@ else
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
} else {
foreach($document_data['parents'] as $document_sub_data) {
if ($document_data['title'] == $document_sub_data['title']) {
continue;
@ -118,7 +118,7 @@ if (empty($document_data['parents'])) {
}
}
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
if (!$is_allowedToEdit) {
api_not_allowed(true);
@ -127,10 +127,10 @@ if (!$is_allowedToEdit) {
event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editpaint">'.Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment' ),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo '</div>';
///pixlr
$title=$file;//disk name. No sql name because pixlr return this when save
@ -181,7 +181,7 @@ $htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
if (!file_exists($htaccess)) {
$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
if ($fp) {
fwrite($fp, $htaccess_content);
@ -190,7 +190,7 @@ if (!file_exists($htaccess)) {
}
$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
if (!file_exists($html_index)) {
if (!file_exists($html_index)) {
$html_index_content="<html><head></head><body></body></html>";
$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
if ($fp) {
@ -200,7 +200,7 @@ if (!file_exists($html_index)) {
}
//encript temp name file
$name_crip=sha1(uniqid());//encript
$name_crip=sha1(uniqid());//encript
$findext= explode(".", $file);
$extension= $findext[count($findext)-1];
$file_crip=$name_crip.'.'.$extension;
@ -215,7 +215,7 @@ $_SESSION['temp_realpath_image']=$to;
$to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
$image=urlencode($to_url);
$pixlr_url = 'http://pixlr.com/editor/?title='.$title.'&amp;image='.$image.'&amp;loc='.$loc.'&amp;referrer='.$referrer.'&amp;target='.$target.'&amp;exit='.$exit_path.'&amp;locktarget='.$locktarget.'&amp;locktitle='.$locktitle.'&amp;credentials='.$credentials;
//make frame an send image
?>

@ -84,7 +84,7 @@ if (isset ($_SESSION['_gid']) && $_SESSION['_gid'] != 0) {
$interbreadcrumb[] = array ("url" => "./document.php?id=".$document_id.$req_gid, "name" => get_lang('Documents'));
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) {
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) {
api_not_allowed(true);
}

@ -92,7 +92,7 @@ if (isset ($_SESSION['_gid']) && $_SESSION['_gid'] != 0) {
$interbreadcrumb[] = array ("url" => "./document.php?id=".$document_id.$req_gid, "name" => get_lang('Documents'));
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) {
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) {
api_not_allowed(true);
}

@ -91,7 +91,7 @@ if (isset ($_SESSION['_gid']) && $_SESSION['_gid'] != 0) {
$interbreadcrumb[] = array ("url" => "./document.php?id=".$document_id.$req_gid, "name" => get_lang('Documents'));
if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) {
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) {
api_not_allowed(true);
}

@ -2460,4 +2460,9 @@ class GroupManager
$form->addElement('button', 'submit', get_lang('Search'));
return $form->toHtml();
}
public static function groupMemberWithUploadRights()
{
return isset($_SESSION['group_member_with_upload_rights']) ? $_SESSION['group_member_with_upload_rights'] : false;
}
}

Loading…
Cancel
Save