@@ -457,28 +457,28 @@ discard block |
||
457 | 457 | |
458 | 458 | // Prepare error message |
459 | 459 | if (value.pw_status === "encryption_error") { |
460 | - pwd_error = '<span class="fa fa-warning fa-sm mi-red tip" title="<?php echo addslashes($LANG['pw_encryption_error']);?>"></span> '; |
|
460 | + pwd_error = '<span class="fa fa-warning fa-sm mi-red tip" title="<?php echo addslashes($LANG['pw_encryption_error']); ?>"></span> '; |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | // Prepare anyone can modify icon |
464 | 464 | if (value.anyone_can_modify === "1") { |
465 | - icon_all_can_modify = '<span class="fa fa-pencil fa-sm mi-grey-1 pointer tip" title="<?php echo addslashes($LANG['item_menu_collab_enable']);?>" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')"></span> '; |
|
465 | + icon_all_can_modify = '<span class="fa fa-pencil fa-sm mi-grey-1 pointer tip" title="<?php echo addslashes($LANG['item_menu_collab_enable']); ?>" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')"></span> '; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | // Prepare mini icons |
469 | 469 | if (value.copy_to_clipboard_small_icons === "1" && value.display_item === 1) { |
470 | 470 | // Login icon |
471 | 471 | if (value.login !== "") { |
472 | - icon_login = '<span class="fa fa-sm fa-user mi-black mini_login" data-clipboard-text="'+sanitizeString(value.login)+'" title="<?php echo addslashes($LANG['item_menu_copy_login']);?>" id="minilogin_'+value.item_id+'"></span> '; |
|
472 | + icon_login = '<span class="fa fa-sm fa-user mi-black mini_login" data-clipboard-text="'+sanitizeString(value.login)+'" title="<?php echo addslashes($LANG['item_menu_copy_login']); ?>" id="minilogin_'+value.item_id+'"></span> '; |
|
473 | 473 | } |
474 | 474 | // Pwd icon |
475 | 475 | if (value.pw !== "") { |
476 | - icon_pwd = '<span class="fa fa-sm fa-lock mi-black mini_pw" data-clipboard-text="'+sanitizeString(value.pw)+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']);?>" data-clipboard-id="'+value.item_id+'" id="minipwd_'+value.item_id+'"></span> '; |
|
476 | + icon_pwd = '<span class="fa fa-sm fa-lock mi-black mini_pw" data-clipboard-text="'+sanitizeString(value.pw)+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']); ?>" data-clipboard-id="'+value.item_id+'" id="minipwd_'+value.item_id+'"></span> '; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | // Now check if pwd is empty. If it is then warn user |
480 | 480 | if (value.pw === "") { |
481 | - pwd_error = ' <span class="fa fa-exclamation-circle fa-sm mi-yellow tip" title="<?php echo addslashes($LANG['password_is_empty']);?>"></span> '; |
|
481 | + pwd_error = ' <span class="fa fa-exclamation-circle fa-sm mi-yellow tip" title="<?php echo addslashes($LANG['password_is_empty']); ?>"></span> '; |
|
482 | 482 | } |
483 | 483 | } |
484 | 484 | |
@@ -2409,8 +2409,8 @@ discard block |
||
2409 | 2409 | $("#delete-edit-file_"+file_id) |
2410 | 2410 | .hide() |
2411 | 2411 | .after( |
2412 | - '<span class="delete_me"> <span id="confirm-delete-edit-file_'+file_id+'" class="fa fa-thumbs-up tip" style="cursor:pointer;" onclick="delete_attached_file('+file_id+', 1)" title="<?php echo addslashes($LANG['confirm']);?>"></span>' + |
|
2413 | - ' <span id="cancel-delete-edit-file_'+file_id+'" class="fa fa-thumbs-down tip" style="cursor:pointer;" onclick="cancel_delete_attached_file('+file_id+')" title="<?php echo addslashes($LANG['cancel']);?>"></span> </span>' |
|
2412 | + '<span class="delete_me"> <span id="confirm-delete-edit-file_'+file_id+'" class="fa fa-thumbs-up tip" style="cursor:pointer;" onclick="delete_attached_file('+file_id+', 1)" title="<?php echo addslashes($LANG['confirm']); ?>"></span>' + |
|
2413 | + ' <span id="cancel-delete-edit-file_'+file_id+'" class="fa fa-thumbs-down tip" style="cursor:pointer;" onclick="cancel_delete_attached_file('+file_id+')" title="<?php echo addslashes($LANG['cancel']); ?>"></span> </span>' |
|
2414 | 2414 | ); |
2415 | 2415 | $(".tip").tooltipster({multiple: true}); |
2416 | 2416 | } |
@@ -2631,9 +2631,9 @@ discard block |
||
2631 | 2631 | |
2632 | 2632 | // Shall we show the root folder |
2633 | 2633 | if (data.html_json.can_create_root_folder === 1) { |
2634 | - html_visible = '<option value="0"><?php echo addslashes($LANG['root']);?></option>'; |
|
2635 | - html_full_visible = '<option value="0"><?php echo addslashes($LANG['root']);?></option>'; |
|
2636 | - html_active_visible = '<option value="0"><?php echo addslashes($LANG['root']);?></option>'; |
|
2634 | + html_visible = '<option value="0"><?php echo addslashes($LANG['root']); ?></option>'; |
|
2635 | + html_full_visible = '<option value="0"><?php echo addslashes($LANG['root']); ?></option>'; |
|
2636 | + html_active_visible = '<option value="0"><?php echo addslashes($LANG['root']); ?></option>'; |
|
2637 | 2637 | } |
2638 | 2638 | |
2639 | 2639 | // |
@@ -4674,20 +4674,20 @@ discard block |
||
4674 | 4674 | if (value.copy_to_clipboard_small_icons === '1') { |
4675 | 4675 | // Prepare Login |
4676 | 4676 | if (value.login !== "") { |
4677 | - value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']);?>"></span> '; |
|
4677 | + value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']); ?>"></span> '; |
|
4678 | 4678 | } |
4679 | 4679 | |
4680 | 4680 | // Prepare PWD |
4681 | 4681 | if (value.pw !== "") { |
4682 | - value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']);?>"></span> ' |
|
4682 | + value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']); ?>"></span> ' |
|
4683 | 4683 | } |
4684 | 4684 | |
4685 | 4685 | // Prepare favorite |
4686 | 4686 | if (value.enable_favourites === '1') { |
4687 | 4687 | if (value.is_favorite === '1') { |
4688 | - icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']);?>"></span>'; |
|
4688 | + icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']); ?>"></span>'; |
|
4689 | 4689 | } else { |
4690 | - icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']);?>"></span>'; |
|
4690 | + icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']); ?>"></span>'; |
|
4691 | 4691 | } |
4692 | 4692 | } else { |
4693 | 4693 | icon_favorite = ''; |
@@ -4701,7 +4701,7 @@ discard block |
||
4701 | 4701 | // Append |
4702 | 4702 | $("#full_items_list").append( |
4703 | 4703 | '<li class="item trunc_line" id="'+value.item_id+'"><a id="fileclass'+value.item_id+'" class="file_search">' + |
4704 | - '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']);?>"></span> ' + |
|
4704 | + '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']); ?>"></span> ' + |
|
4705 | 4705 | '<span class="truncate" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \'\', \''+value.reload+'\', \''+value.tree_id+'\')"><b>'+value.label + '</b>' + |
4706 | 4706 | ' <span style="font-size:11px;font-style:italic; background-color:#f2e9e5;"> <i class="fa fa-folder-o"></i> '+value.folder+' </span> '+value.desc+'' + |
4707 | 4707 | '</span><span style="float:right;margin:2px 10px 0px 0px;">' + |
@@ -4758,20 +4758,20 @@ discard block |
||
4758 | 4758 | if (value.copy_to_clipboard_small_icons === "1") { |
4759 | 4759 | // Prepare Login |
4760 | 4760 | if (value.login !== "") { |
4761 | - value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']);?>"></span> '; |
|
4761 | + value.login = '<span class="fa fa-user fa-lg mi-black mini_login tip" data-clipboard-text="'+value.login+'" title="<?php echo addslashes($LANG['item_menu_copy_login']); ?>"></span> '; |
|
4762 | 4762 | } |
4763 | 4763 | |
4764 | 4764 | // Prepare PWD |
4765 | 4765 | if (value.pw !== "") { |
4766 | - value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']);?>"></span> ' |
|
4766 | + value.pw = '<span class="fa fa-lock fa-lg mi-black mini_pw tip" data-clipboard-text="'+value.pw+'" title="<?php echo addslashes($LANG['item_menu_copy_pw']); ?>"></span> ' |
|
4767 | 4767 | } |
4768 | 4768 | |
4769 | 4769 | // Prepare favorite |
4770 | 4770 | if (value.enable_favourites === "1") { |
4771 | 4771 | if (value.is_favorite === 1) { |
4772 | - icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']);?>"></span>'; |
|
4772 | + icon_favorite = '<span class="fa fa-star fa-lg mi-yellow tip" onclick="ActionOnQuickIcon('+value.item_id+',0)" class="tip" title="<?php echo addslashes($LANG['item_menu_del_from_fav']); ?>"></span>'; |
|
4773 | 4773 | } else { |
4774 | - icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']);?>"></span>'; |
|
4774 | + icon_favorite = '<span class="fa fa-star-o fa-lg tip" onclick="ActionOnQuickIcon('+value.item_id+',1)" class="tip" title="<?php echo addslashes($LANG['item_menu_add_to_fav']); ?>"></span>'; |
|
4775 | 4775 | } |
4776 | 4776 | } else { |
4777 | 4777 | icon_favorite = ''; |
@@ -4785,7 +4785,7 @@ discard block |
||
4785 | 4785 | // Append |
4786 | 4786 | $("#full_items_list").append( |
4787 | 4787 | '<li class="item trunc_line" id="'+value.item_id+'"><a id="fileclass'+value.item_id+'" class="file_search">' + |
4788 | - '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']);?>"></span> ' + |
|
4788 | + '<span class="fa fa-key mi-yellow tip" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \''+value.open_edit+'\', \''+value.reload+'\', \''+value.tree_id+'\')" title="<?php echo addslashes($LANG['click_to_edit']); ?>"></span> ' + |
|
4789 | 4789 | '<span class="truncate" onclick="AfficherDetailsItem(\''+value.item_id+'\',\''+value.sk+'\',\''+value.expired+'\', \''+value.restricted+'\', \''+value.display+'\', \'\', \''+value.reload+'\', \''+value.tree_id+'\')">'+value.label + |
4790 | 4790 | value.desc + |
4791 | 4791 | ' <span style="font-size:11px;font-style:italic;"><i class="fa fa-folder-o"></i> '+value.folder+'</span>' + |
@@ -2191,12 +2191,12 @@ discard block |
||
2191 | 2191 | |
2192 | 2192 | // Check that user can access this folder |
2193 | 2193 | if (( |
2194 | - in_array($post_source_folder_id, $_SESSION['groupes_visibles']) === false || |
|
2194 | + in_array($post_source_folder_id, $_SESSION['groupes_visibles']) === false || |
|
2195 | 2195 | in_array($post_target_folder_id, $_SESSION['groupes_visibles']) === false) && |
2196 | 2196 | ( |
2197 | - $post_target_folder_id === '0' && |
|
2197 | + $post_target_folder_id === '0' && |
|
2198 | 2198 | isset($SETTINGS['can_create_root_folder']) === true && $SETTINGS['can_create_root_folder'] === '1' |
2199 | - ) |
|
2199 | + ) |
|
2200 | 2200 | ) { |
2201 | 2201 | $returnValues = '[{"error" : "'.addslashes($LANG['error_not_allowed_to']).'"}]'; |
2202 | 2202 | echo $returnValues; |
@@ -3201,7 +3201,7 @@ discard block |
||
3201 | 3201 | if ((isset($_SESSION['user_settings']['session_psk']) === false || empty($_SESSION['user_settings']['session_psk']) === true) |
3202 | 3202 | && ($dataSource['personal_folder'] === '1' || $dataDestination['personal_folder'] === '1') |
3203 | 3203 | ) { |
3204 | - echo '[{"error" : "ERR_PSK_REQUIRED"}]'; |
|
3204 | + echo '[{"error" : "ERR_PSK_REQUIRED"}]'; |
|
3205 | 3205 | break; |
3206 | 3206 | } |
3207 | 3207 | |
@@ -4340,19 +4340,19 @@ discard block |
||
4340 | 4340 | $ret = sendEmail( |
4341 | 4341 | $LANG['email_request_access_subject'], |
4342 | 4342 | str_replace( |
4343 | - array( |
|
4344 | - '#tp_item_author#', |
|
4345 | - '#tp_user#', |
|
4346 | - '#tp_item#', |
|
4347 | - '#tp_reason#' |
|
4348 | - ), |
|
4349 | - array( |
|
4350 | - " ".addslashes($dataAuthor['login']), |
|
4351 | - addslashes($_SESSION['login']), |
|
4352 | - $path, |
|
4353 | - nl2br(addslashes($emailText)) |
|
4354 | - ), |
|
4355 | - $LANG['email_request_access_mail'] |
|
4343 | + array( |
|
4344 | + '#tp_item_author#', |
|
4345 | + '#tp_user#', |
|
4346 | + '#tp_item#', |
|
4347 | + '#tp_reason#' |
|
4348 | + ), |
|
4349 | + array( |
|
4350 | + " ".addslashes($dataAuthor['login']), |
|
4351 | + addslashes($_SESSION['login']), |
|
4352 | + $path, |
|
4353 | + nl2br(addslashes($emailText)) |
|
4354 | + ), |
|
4355 | + $LANG['email_request_access_mail'] |
|
4356 | 4356 | ), |
4357 | 4357 | $dataAuthor['email'], |
4358 | 4358 | $LANG, |
@@ -4361,11 +4361,11 @@ discard block |
||
4361 | 4361 | |
4362 | 4362 | // Do log |
4363 | 4363 | logItems( |
4364 | - $item_id, |
|
4365 | - $dataItem['label'], |
|
4366 | - $_SESSION['user_id'], |
|
4367 | - 'at_access', |
|
4368 | - $_SESSION['login'] |
|
4364 | + $item_id, |
|
4365 | + $dataItem['label'], |
|
4366 | + $_SESSION['user_id'], |
|
4367 | + 'at_access', |
|
4368 | + $_SESSION['login'] |
|
4369 | 4369 | ); |
4370 | 4370 | |
4371 | 4371 | // Return |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | /*FOLDER */ |
897 | 897 | if ($data['id_tree'] != $dataReceived['categorie']) { |
898 | 898 | // Get name of folders |
899 | - $dataTmp = DB::query("SELECT title FROM ".prefix_table("nested_tree")." WHERE id IN %li", array($data['id_tree'],$dataReceived['categorie'])); |
|
899 | + $dataTmp = DB::query("SELECT title FROM ".prefix_table("nested_tree")." WHERE id IN %li", array($data['id_tree'], $dataReceived['categorie'])); |
|
900 | 900 | |
901 | 901 | logItems($dataReceived['id'], $label, $_SESSION['user_id'], 'at_modification', $_SESSION['login'], 'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title']); |
902 | 902 | // ask for page reloading |
@@ -1974,7 +1974,7 @@ discard block |
||
1974 | 1974 | if (empty($path) === true) { |
1975 | 1975 | $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
1976 | 1976 | } else { |
1977 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
1977 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
1978 | 1978 | } |
1979 | 1979 | } |
1980 | 1980 | // Build text to show user |
@@ -4474,7 +4474,7 @@ discard block |
||
4474 | 4474 | if (empty($path) === true) { |
4475 | 4475 | $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
4476 | 4476 | } else { |
4477 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
4477 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
4478 | 4478 | } |
4479 | 4479 | } |
4480 | 4480 | // Build text to show user |
@@ -12,15 +12,15 @@ |
||
12 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
13 | 13 | */ |
14 | 14 | |
15 | -require dirname(__FILE__) .'/../includes/config/settings.php'; |
|
16 | -require_once dirname(__FILE__) .'/../includes/config/tp.config.php'; |
|
15 | +require dirname(__FILE__).'/../includes/config/settings.php'; |
|
16 | +require_once dirname(__FILE__).'/../includes/config/tp.config.php'; |
|
17 | 17 | header("Content-type: text/html; charset=utf-8"); |
18 | 18 | |
19 | 19 | $_SESSION['CPM'] = 1; |
20 | 20 | |
21 | 21 | // connect to DB |
22 | -require_once $SETTINGS['cpassman_dir'] .'/sources/SplClassLoader.php'; |
|
23 | -require_once $SETTINGS['cpassman_dir'] .'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
22 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
23 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
24 | 24 | |
25 | 25 | // Load libraries |
26 | 26 | require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
@@ -452,23 +452,23 @@ discard block |
||
452 | 452 | break; |
453 | 453 | |
454 | 454 | //CASE export in HTML format |
455 | - case "export_to_html_format": |
|
456 | - // step 1: |
|
457 | - // - prepare export file |
|
458 | - // - get full list of objects id to export |
|
459 | - include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
460 | - include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
461 | - $idsList = array(); |
|
462 | - $objNumber = 0; |
|
463 | - |
|
464 | - foreach (explode(';', $post_ids) as $id) { |
|
465 | - if (in_array($id, $_SESSION['forbiden_pfs']) === false |
|
466 | - && in_array($id, $_SESSION['groupes_visibles']) === true |
|
467 | - && (in_array($id, $_SESSION['no_access_folders']) === false) |
|
468 | - ) { |
|
469 | - // count elements to display |
|
470 | - $result = DB::query( |
|
471 | - "SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso |
|
455 | + case "export_to_html_format": |
|
456 | + // step 1: |
|
457 | + // - prepare export file |
|
458 | + // - get full list of objects id to export |
|
459 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
460 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
461 | + $idsList = array(); |
|
462 | + $objNumber = 0; |
|
463 | + |
|
464 | + foreach (explode(';', $post_ids) as $id) { |
|
465 | + if (in_array($id, $_SESSION['forbiden_pfs']) === false |
|
466 | + && in_array($id, $_SESSION['groupes_visibles']) === true |
|
467 | + && (in_array($id, $_SESSION['no_access_folders']) === false) |
|
468 | + ) { |
|
469 | + // count elements to display |
|
470 | + $result = DB::query( |
|
471 | + "SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso |
|
472 | 472 | FROM ".prefix_table("items")." as i |
473 | 473 | INNER JOIN ".prefix_table("nested_tree")." as n ON (i.id_tree = n.id) |
474 | 474 | INNER JOIN ".prefix_table("log_items")." as l ON (i.id = l.id_item) |
@@ -476,41 +476,41 @@ discard block |
||
476 | 476 | AND i.id_tree= %i |
477 | 477 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
478 | 478 | ORDER BY i.label ASC, l.date DESC", |
479 | - "0", |
|
480 | - $id, |
|
481 | - "at_creation", |
|
482 | - "at_modification", |
|
483 | - "at_pw :%" |
|
484 | - ); |
|
485 | - foreach ($result as $record) { |
|
486 | - $restricted_users_array = explode(';', $record['restricted_to']); |
|
487 | - if (((in_array($id, $_SESSION['personal_visible_groups']) === true |
|
488 | - && !($record['perso'] == 1 && $_SESSION['user_id'] == $record['restricted_to']) |
|
489 | - && empty($record['restricted_to']) === false) |
|
490 | - || |
|
491 | - (empty($record['restricted_to']) === false |
|
492 | - && in_array($_SESSION['user_id'], $restricted_users_array) === false) |
|
493 | - || |
|
494 | - (in_array($id, $_SESSION['groupes_visibles'])) |
|
495 | - ) && ( |
|
496 | - in_array($record['id'], $idsList) === false |
|
497 | - ) |
|
498 | - ) { |
|
499 | - array_push($idsList, $record['id']); |
|
500 | - $objNumber++; |
|
479 | + "0", |
|
480 | + $id, |
|
481 | + "at_creation", |
|
482 | + "at_modification", |
|
483 | + "at_pw :%" |
|
484 | + ); |
|
485 | + foreach ($result as $record) { |
|
486 | + $restricted_users_array = explode(';', $record['restricted_to']); |
|
487 | + if (((in_array($id, $_SESSION['personal_visible_groups']) === true |
|
488 | + && !($record['perso'] == 1 && $_SESSION['user_id'] == $record['restricted_to']) |
|
489 | + && empty($record['restricted_to']) === false) |
|
490 | + || |
|
491 | + (empty($record['restricted_to']) === false |
|
492 | + && in_array($_SESSION['user_id'], $restricted_users_array) === false) |
|
493 | + || |
|
494 | + (in_array($id, $_SESSION['groupes_visibles'])) |
|
495 | + ) && ( |
|
496 | + in_array($record['id'], $idsList) === false |
|
497 | + ) |
|
498 | + ) { |
|
499 | + array_push($idsList, $record['id']); |
|
500 | + $objNumber++; |
|
501 | + } |
|
501 | 502 | } |
502 | 503 | } |
503 | 504 | } |
504 | - } |
|
505 | 505 | |
506 | - // prepare export file |
|
507 | - //save the file |
|
508 | - $html_file = '/teampass_export_'.time().'_'.generateKey().'.html'; |
|
509 | - //print_r($full_listing); |
|
510 | - $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, "w"); |
|
511 | - fwrite( |
|
512 | - $outstream, |
|
513 | - '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
506 | + // prepare export file |
|
507 | + //save the file |
|
508 | + $html_file = '/teampass_export_'.time().'_'.generateKey().'.html'; |
|
509 | + //print_r($full_listing); |
|
510 | + $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, "w"); |
|
511 | + fwrite( |
|
512 | + $outstream, |
|
513 | + '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
514 | 514 | <head> |
515 | 515 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
516 | 516 | <title>TeamPass Off-line mode</title> |
@@ -550,38 +550,38 @@ discard block |
||
550 | 550 | <th style="width:20%;">'.$LANG['url'].'</th> |
551 | 551 | </tr></thead> |
552 | 552 | <tbody id="itemsTable_tbody">' |
553 | - ); |
|
554 | - |
|
555 | - fclose($outstream); |
|
553 | + ); |
|
556 | 554 | |
557 | - // send back and continue |
|
558 | - echo '[{"loop":"true", "number":"'.$objNumber.'", "file":"'.$SETTINGS['path_to_files_folder'].$html_file.'" , "file_link":"'.$SETTINGS['url_to_files_folder'].$html_file.'"}]'; |
|
559 | - break; |
|
555 | + fclose($outstream); |
|
560 | 556 | |
561 | - //CASE export in HTML format - Iteration loop |
|
562 | - case "export_to_html_format_loop": |
|
563 | - // do checks ... if fails, return an error |
|
564 | - if (null === $post_idTree || null === $post_idsList) { |
|
565 | - echo '[{"error":"true"}]'; |
|
557 | + // send back and continue |
|
558 | + echo '[{"loop":"true", "number":"'.$objNumber.'", "file":"'.$SETTINGS['path_to_files_folder'].$html_file.'" , "file_link":"'.$SETTINGS['url_to_files_folder'].$html_file.'"}]'; |
|
566 | 559 | break; |
567 | - } |
|
568 | 560 | |
569 | - // exclude this folder if not allowed |
|
570 | - if (in_array($post_idTree, $_SESSION['forbiden_pfs']) === true |
|
571 | - || in_array($post_idTree, $_SESSION['groupes_visibles']) === false |
|
572 | - || (in_array($post_idTree, $_SESSION['no_access_folders']) === true) |
|
573 | - ) { |
|
574 | - echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
575 | - break; |
|
576 | - } |
|
561 | + //CASE export in HTML format - Iteration loop |
|
562 | + case "export_to_html_format_loop": |
|
563 | + // do checks ... if fails, return an error |
|
564 | + if (null === $post_idTree || null === $post_idsList) { |
|
565 | + echo '[{"error":"true"}]'; |
|
566 | + break; |
|
567 | + } |
|
577 | 568 | |
578 | - $full_listing = array(); |
|
579 | - $items_id_list = array(); |
|
580 | - include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
581 | - include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
569 | + // exclude this folder if not allowed |
|
570 | + if (in_array($post_idTree, $_SESSION['forbiden_pfs']) === true |
|
571 | + || in_array($post_idTree, $_SESSION['groupes_visibles']) === false |
|
572 | + || (in_array($post_idTree, $_SESSION['no_access_folders']) === true) |
|
573 | + ) { |
|
574 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
575 | + break; |
|
576 | + } |
|
577 | + |
|
578 | + $full_listing = array(); |
|
579 | + $items_id_list = array(); |
|
580 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
581 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
582 | 582 | |
583 | - $rows = DB::query( |
|
584 | - "SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree, |
|
583 | + $rows = DB::query( |
|
584 | + "SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree, |
|
585 | 585 | l.date as date, i.pw_iv as pw_iv, |
586 | 586 | n.renewal_period as renewal_period |
587 | 587 | FROM ".prefix_table("items")." as i |
@@ -591,108 +591,108 @@ discard block |
||
591 | 591 | AND i.id_tree= %i |
592 | 592 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
593 | 593 | ORDER BY i.label ASC, l.date DESC", |
594 | - "0", |
|
595 | - $post_idTree, |
|
596 | - "at_creation", |
|
597 | - "at_modification", |
|
598 | - "at_pw :%" |
|
599 | - ); |
|
600 | - |
|
601 | - foreach ($rows as $record) { |
|
602 | - //exclude all results except the first one returned by query |
|
603 | - if (empty($id_managed) || $id_managed != $record['id']) { |
|
604 | - // decrypt PW |
|
605 | - if (empty($post_salt_key) === false && null !== $post_salt_key) { |
|
606 | - $pw = cryption( |
|
607 | - $record['pw'], |
|
608 | - mysqli_escape_string($link, stripslashes($post_salt_key)), |
|
609 | - "decrypt" |
|
594 | + "0", |
|
595 | + $post_idTree, |
|
596 | + "at_creation", |
|
597 | + "at_modification", |
|
598 | + "at_pw :%" |
|
599 | + ); |
|
600 | + |
|
601 | + foreach ($rows as $record) { |
|
602 | + //exclude all results except the first one returned by query |
|
603 | + if (empty($id_managed) || $id_managed != $record['id']) { |
|
604 | + // decrypt PW |
|
605 | + if (empty($post_salt_key) === false && null !== $post_salt_key) { |
|
606 | + $pw = cryption( |
|
607 | + $record['pw'], |
|
608 | + mysqli_escape_string($link, stripslashes($post_salt_key)), |
|
609 | + "decrypt" |
|
610 | + ); |
|
611 | + } else { |
|
612 | + $pw = cryption( |
|
613 | + $record['pw'], |
|
614 | + "", |
|
615 | + "decrypt" |
|
616 | + ); |
|
617 | + } |
|
618 | + array_push( |
|
619 | + $full_listing, array( |
|
620 | + 'id_tree' => $record['id_tree'], |
|
621 | + 'id' => $record['id'], |
|
622 | + 'label' => $record['label'], |
|
623 | + 'description' => addslashes(str_replace(array(";", "<br />"), array("|", "\n\r"), mysqli_escape_string($link, stripslashes(utf8_decode($record['description']))))), |
|
624 | + 'pw' => $pw['string'], |
|
625 | + 'login' => $record['login'], |
|
626 | + 'url' => $record['url'], |
|
627 | + 'perso' => $record['perso'] |
|
628 | + ) |
|
610 | 629 | ); |
611 | - } else { |
|
612 | - $pw = cryption( |
|
613 | - $record['pw'], |
|
614 | - "", |
|
615 | - "decrypt" |
|
630 | + $i++; |
|
631 | + array_push($items_id_list, $record['id']); |
|
632 | + |
|
633 | + // log |
|
634 | + logItems( |
|
635 | + $record['id'], |
|
636 | + $record['l SeekableIteratorabel'], |
|
637 | + $_SESSION['user_id'], |
|
638 | + 'at_export', |
|
639 | + $_SESSION['login'], |
|
640 | + 'html' |
|
616 | 641 | ); |
617 | 642 | } |
618 | - array_push( |
|
619 | - $full_listing, array( |
|
620 | - 'id_tree' => $record['id_tree'], |
|
621 | - 'id' => $record['id'], |
|
622 | - 'label' => $record['label'], |
|
623 | - 'description' => addslashes(str_replace(array(";", "<br />"), array("|", "\n\r"), mysqli_escape_string($link, stripslashes(utf8_decode($record['description']))))), |
|
624 | - 'pw' => $pw['string'], |
|
625 | - 'login' => $record['login'], |
|
626 | - 'url' => $record['url'], |
|
627 | - 'perso' => $record['perso'] |
|
628 | - ) |
|
629 | - ); |
|
630 | - $i++; |
|
631 | - array_push($items_id_list, $record['id']); |
|
632 | - |
|
633 | - // log |
|
634 | - logItems( |
|
635 | - $record['id'], |
|
636 | - $record['l SeekableIteratorabel'], |
|
637 | - $_SESSION['user_id'], |
|
638 | - 'at_export', |
|
639 | - $_SESSION['login'], |
|
640 | - 'html' |
|
641 | - ); |
|
643 | + $id_managed = $record['id']; |
|
642 | 644 | } |
643 | - $id_managed = $record['id']; |
|
644 | - } |
|
645 | 645 | |
646 | - //save in export file |
|
647 | - $outstream = fopen($post_file.'.txt', "a"); |
|
646 | + //save in export file |
|
647 | + $outstream = fopen($post_file.'.txt', "a"); |
|
648 | 648 | |
649 | - $lineType = "line1"; |
|
650 | - $idTree = ""; |
|
651 | - foreach ($full_listing as $elem) { |
|
652 | - if ($lineType == "line0") { |
|
653 | - $lineType = "line1"; |
|
654 | - } else { |
|
655 | - $lineType = "line0"; |
|
656 | - } |
|
657 | - if (empty($elem['description'])) { |
|
658 | - $desc = ' '; |
|
659 | - } else { |
|
660 | - $desc = addslashes($elem['description']); |
|
661 | - } |
|
662 | - if (empty($elem['login'])) { |
|
663 | - $login = ' '; |
|
664 | - } else { |
|
665 | - $login = addslashes($elem['login']); |
|
666 | - } |
|
667 | - if (empty($elem['url'])) { |
|
668 | - $url = ' '; |
|
669 | - } else { |
|
670 | - $url = addslashes($elem['url']); |
|
671 | - } |
|
649 | + $lineType = "line1"; |
|
650 | + $idTree = ""; |
|
651 | + foreach ($full_listing as $elem) { |
|
652 | + if ($lineType == "line0") { |
|
653 | + $lineType = "line1"; |
|
654 | + } else { |
|
655 | + $lineType = "line0"; |
|
656 | + } |
|
657 | + if (empty($elem['description'])) { |
|
658 | + $desc = ' '; |
|
659 | + } else { |
|
660 | + $desc = addslashes($elem['description']); |
|
661 | + } |
|
662 | + if (empty($elem['login'])) { |
|
663 | + $login = ' '; |
|
664 | + } else { |
|
665 | + $login = addslashes($elem['login']); |
|
666 | + } |
|
667 | + if (empty($elem['url'])) { |
|
668 | + $url = ' '; |
|
669 | + } else { |
|
670 | + $url = addslashes($elem['url']); |
|
671 | + } |
|
672 | 672 | |
673 | - // Prepare tree |
|
674 | - if ($idTree != $elem['id_tree']) { |
|
675 | - $arbo = $tree->getPath($elem['id_tree'], true); |
|
676 | - foreach ($arbo as $folder) { |
|
677 | - $arboHtml_tmp = htmlspecialchars(stripslashes($folder->title), ENT_QUOTES); |
|
678 | - if (empty($arboHtml)) { |
|
679 | - $arboHtml = $arboHtml_tmp; |
|
680 | - } else { |
|
681 | - $arboHtml .= ' » '.$arboHtml_tmp; |
|
673 | + // Prepare tree |
|
674 | + if ($idTree != $elem['id_tree']) { |
|
675 | + $arbo = $tree->getPath($elem['id_tree'], true); |
|
676 | + foreach ($arbo as $folder) { |
|
677 | + $arboHtml_tmp = htmlspecialchars(stripslashes($folder->title), ENT_QUOTES); |
|
678 | + if (empty($arboHtml)) { |
|
679 | + $arboHtml = $arboHtml_tmp; |
|
680 | + } else { |
|
681 | + $arboHtml .= ' » '.$arboHtml_tmp; |
|
682 | + } |
|
682 | 683 | } |
684 | + fputs( |
|
685 | + $outstream, |
|
686 | + ' |
|
687 | + <tr class="path"><td colspan="5">'.$arboHtml.'</td></tr>' |
|
688 | + ); |
|
689 | + $idTree = $elem['id_tree']; |
|
683 | 690 | } |
691 | + |
|
692 | + $encPw = GibberishAES::enc($elem['pw'], $post_pdf_password); |
|
684 | 693 | fputs( |
685 | 694 | $outstream, |
686 | 695 | ' |
687 | - <tr class="path"><td colspan="5">'.$arboHtml.'</td></tr>' |
|
688 | - ); |
|
689 | - $idTree = $elem['id_tree']; |
|
690 | - } |
|
691 | - |
|
692 | - $encPw = GibberishAES::enc($elem['pw'], $post_pdf_password); |
|
693 | - fputs( |
|
694 | - $outstream, |
|
695 | - ' |
|
696 | 696 | <tr class="'.$lineType.'"> |
697 | 697 | <td>'.addslashes($elem['label']).'</td> |
698 | 698 | <td align="center"><span class="span_pw" id="span_'.$elem['id'].'"><a href="#" onclick="decryptme('.$elem['id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$elem['id'].'" value="'.$encPw.'" /></td> |
@@ -700,16 +700,16 @@ discard block |
||
700 | 700 | <td align="center">'.$login.'</td> |
701 | 701 | <td align="center">'.$url.'</td> |
702 | 702 | </tr>' |
703 | - ); |
|
704 | - } |
|
703 | + ); |
|
704 | + } |
|
705 | 705 | |
706 | - fclose($outstream); |
|
706 | + fclose($outstream); |
|
707 | 707 | |
708 | - // send back and continue |
|
709 | - echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
710 | - break; |
|
708 | + // send back and continue |
|
709 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
710 | + break; |
|
711 | 711 | |
712 | - //CASE export in HTML format - Iteration loop |
|
712 | + //CASE export in HTML format - Iteration loop |
|
713 | 713 | case "export_to_html_format_finalize": |
714 | 714 | // Load includes |
715 | 715 | include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
14 | 14 | */ |
15 | 15 | global $LANG; |
16 | -$LANG = array ( |
|
16 | +$LANG = array( |
|
17 | 17 | 'provide_yubico_identifiers' => 'Please provide your Yubico identifiers', |
18 | 18 | 'admin_yubico_authentication_setting' => 'Enable Yubico authentication', |
19 | 19 | 'yubico_user_id' => 'Client ID', |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
14 | 14 | */ |
15 | 15 | global $LANG; |
16 | -$LANG = array ( |
|
16 | +$LANG = array( |
|
17 | 17 | 'provide_yubico_identifiers' => 'Merci de fournir vos identifiants Yubico', |
18 | 18 | 'admin_yubico_authentication_setting' => 'Activer la double identification avec Yubico', |
19 | 19 | 'yubico_user_id' => 'ID client', |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
14 | 14 | */ |
15 | 15 | global $LANG; |
16 | -$LANG = array ( |
|
16 | +$LANG = array( |
|
17 | 17 | 'provide_yubico_identifiers' => 'Please provide your Yubico identifiers', |
18 | 18 | 'admin_yubico_authentication_setting' => 'Enable Yubico authentication', |
19 | 19 | 'yubico_user_id' => 'Client ID', |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
14 | 14 | */ |
15 | 15 | global $LANG; |
16 | -$LANG = array ( |
|
16 | +$LANG = array( |
|
17 | 17 | 'provide_yubico_identifiers' => 'Please provide your Yubico identifiers', |
18 | 18 | 'admin_yubico_authentication_setting' => 'Enable Yubico authentication', |
19 | 19 | 'yubico_user_id' => 'Client ID', |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
14 | 14 | */ |
15 | 15 | global $LANG; |
16 | -$LANG = array ( |
|
16 | +$LANG = array( |
|
17 | 17 | 'provide_yubico_identifiers' => 'Please provide your Yubico identifiers', |
18 | 18 | 'admin_yubico_authentication_setting' => 'Enable Yubico authentication', |
19 | 19 | 'yubico_user_id' => 'Client ID', |