@@ -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 |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | /*FOLDER */ |
969 | 969 | if ($data['id_tree'] != $dataReceived['categorie']) { |
970 | 970 | // Get name of folders |
971 | - $dataTmp = DB::query("SELECT title FROM ".prefix_table("nested_tree")." WHERE id IN %li", array($data['id_tree'],$dataReceived['categorie'])); |
|
971 | + $dataTmp = DB::query("SELECT title FROM ".prefix_table("nested_tree")." WHERE id IN %li", array($data['id_tree'], $dataReceived['categorie'])); |
|
972 | 972 | |
973 | 973 | logItems( |
974 | 974 | $dataReceived['id'], |
@@ -2090,7 +2090,7 @@ discard block |
||
2090 | 2090 | if (empty($path) === true) { |
2091 | 2091 | $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
2092 | 2092 | } else { |
2093 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
2093 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
2094 | 2094 | } |
2095 | 2095 | } |
2096 | 2096 | // Build text to show user |
@@ -4593,7 +4593,7 @@ discard block |
||
4593 | 4593 | if (empty($path) === true) { |
4594 | 4594 | $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
4595 | 4595 | } else { |
4596 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
4596 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
4597 | 4597 | } |
4598 | 4598 | } |
4599 | 4599 | // 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'; |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | if (val[4] !== "") { |
221 | 221 | newList += '<span id="encryt_data_'+val[1]+'" style="margin-left:4px; cursor:pointer;">'; |
222 | 222 | if (val[4] === "1") { |
223 | - newList += '<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data'];?>"></i>'; |
|
223 | + newList += '<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data']; ?>"></i>'; |
|
224 | 224 | } else if (val[4] === "0") { |
225 | - newList += '<span class="fa-stack tip" title="<?php echo $LANG['not_encrypted_data'];?>">'+ |
|
225 | + newList += '<span class="fa-stack tip" title="<?php echo $LANG['not_encrypted_data']; ?>">'+ |
|
226 | 226 | '<span class="fa fa-key fa-stack-1x"></span><span class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></span></span>'; |
227 | 227 | } |
228 | 228 | newList += '</span>' |
@@ -231,20 +231,20 @@ discard block |
||
231 | 231 | if (val[6] !== "") { |
232 | 232 | newList += '<span style="margin-left:4px;">'; |
233 | 233 | if (val[6] === "text") { |
234 | - newList += '<span class="fa fa-paragraph tip" title="<?php echo $LANG['text'];?>"></span>'; |
|
234 | + newList += '<span class="fa fa-paragraph tip" title="<?php echo $LANG['text']; ?>"></span>'; |
|
235 | 235 | } else if (val[6] === "textarea") { |
236 | - newList += '<span class="fa fa-align-justify tip" title="<?php echo $LANG['textarea'];?>"></span>'; |
|
236 | + newList += '<span class="fa fa-align-justify tip" title="<?php echo $LANG['textarea']; ?>"></span>'; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | if (val[7] === "1") { |
240 | - newList += ' <span class="fa fa-eye-slash tip" title="<?php echo $LANG['data_is_masked'];?>"></ispan>'; |
|
240 | + newList += ' <span class="fa fa-eye-slash tip" title="<?php echo $LANG['data_is_masked']; ?>"></ispan>'; |
|
241 | 241 | } |
242 | 242 | newList += '</span>' |
243 | 243 | } |
244 | 244 | |
245 | 245 | // Manage display Roles visibility |
246 | 246 | newList += '<td colspan="1" style="border-bottom:1px solid #a0a0a0;">' + |
247 | - '<?php echo $LANG['visible_by'];?>: <span style="font-family:italic;">' + val[8] + |
|
247 | + '<?php echo $LANG['visible_by']; ?>: <span style="font-family:italic;">' + val[8] + |
|
248 | 248 | '</span><input type="hidden" id="roleVisibilityList_'+val[1]+'" value="' + val[9] + '" /></td></tr>'; |
249 | 249 | } |
250 | 250 | }); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $("#categories_list").html(newList); |
256 | 256 | } else { |
257 | 257 | $("#no_category") |
258 | - .html("<?php echo addslashes($LANG['no_category_defined']);?>") |
|
258 | + .html("<?php echo addslashes($LANG['no_category_defined']); ?>") |
|
259 | 259 | .removeClass("hidden"); |
260 | 260 | } |
261 | 261 | $('.tip').tooltipster({multiple: true}); |
@@ -1101,8 +1101,8 @@ discard block |
||
1101 | 1101 | function(data) { |
1102 | 1102 | data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key']; ?>"); |
1103 | 1103 | |
1104 | - var html_admin_by = '<option value="">-- <?php echo addslashes($LANG['select']);?> --</option>', |
|
1105 | - html_roles = '<option value="">-- <?php echo addslashes($LANG['select']);?> --</option>', |
|
1104 | + var html_admin_by = '<option value="">-- <?php echo addslashes($LANG['select']); ?> --</option>', |
|
1105 | + html_roles = '<option value="">-- <?php echo addslashes($LANG['select']); ?> --</option>', |
|
1106 | 1106 | selected_admin_by = 0, |
1107 | 1107 | selected_role = 0; |
1108 | 1108 | |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | if (data[i].selected_role === 1) { |
1114 | 1114 | selected_role = data[i].id; |
1115 | 1115 | } |
1116 | - html_admin_by += '<option value="'+data[i].id+'"><?php echo addslashes($LANG['managers_of']." ");?>'+data[i].title+'</option>'; |
|
1116 | + html_admin_by += '<option value="'+data[i].id+'"><?php echo addslashes($LANG['managers_of']." "); ?>'+data[i].title+'</option>'; |
|
1117 | 1117 | html_roles += '<option value="'+data[i].id+'">'+data[i].title+'</option>'; |
1118 | 1118 | } |
1119 | 1119 | $("#ldap_new_user_is_administrated_by").append(html_admin_by); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $roleVisibility = $LANG['every_roles']; |
242 | 242 | } else { |
243 | 243 | $roleVisibility = ''; |
244 | - foreach(explode(',', $field['role_visibility']) as $role) { |
|
244 | + foreach (explode(',', $field['role_visibility']) as $role) { |
|
245 | 245 | $data = DB::queryFirstRow( |
246 | 246 | "SELECT title |
247 | 247 | FROM ".$pre."roles_title |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | <input type="text" id="catOrd_'.$field['id'].'" size="1" class="category_order" value="'.$field['order'].'" /> |
461 | 461 | <input type="radio" name="sel_item" id="item_'.$field['id'].'_cat" /> |
462 | 462 | <label for="item_'.$field['id'].'_cat" id="item_'.$field['id'].'">'.($field['title']).'</label> |
463 | - <span id="encryt_data_'.$field['id'].'" style="margin-left:4px; cursor:pointer;">'. (isset($field['encrypted_data']) && $field['encrypted_data'] === "1") ? '<i class="fa fa-key tip" title="'.$LANG['encrypted_data'].'" onclick="changeEncrypMode(\''.$field['id'].'\', \'1\')"></i>' : '<span class="fa-stack" title="'.$LANG['not_encrypted_data'].'" onclick="changeEncrypMode(\''.$field['id'].'\', \'0\')"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>'. ' |
|
463 | + <span id="encryt_data_'.$field['id'].'" style="margin-left:4px; cursor:pointer;">'.(isset($field['encrypted_data']) && $field['encrypted_data'] === "1") ? '<i class="fa fa-key tip" title="'.$LANG['encrypted_data'].'" onclick="changeEncrypMode(\''.$field['id'].'\', \'1\')"></i>' : '<span class="fa-stack" title="'.$LANG['not_encrypted_data'].'" onclick="changeEncrypMode(\''.$field['id'].'\', \'0\')"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>'.' |
|
464 | 464 | </span>'; |
465 | 465 | if (isset($field['type'])) { |
466 | 466 | if ($field['type'] === "text") { |
@@ -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 | 'position_in_list' => 'Position in list', |
18 | 18 | 'visible_by' => 'Visible by', |
19 | 19 | 'restrict_visibility_to' => 'Restrict visibility to', |
@@ -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 | 'visible_by' => 'Visible by', |
18 | 18 | 'restrict_visibility_to' => 'Restrict visibility to', |
19 | 19 | 'every_roles' => 'Every roles', |
@@ -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 | 'position_in_list' => 'Position', |
18 | 18 | 'visible_by' => 'Visible par', |
19 | 19 | 'restrict_visibility_to' => 'Uniquement visible par', |
@@ -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 | 'position_in_list' => 'Position in list', |
18 | 18 | 'visible_by' => 'Visible by', |
19 | 19 | 'restrict_visibility_to' => 'Restrict visibility to', |