diff --git a/lib/version.inc b/lib/version.inc index c31795cee5..9ae5060a91 100644 --- a/lib/version.inc +++ b/lib/version.inc @@ -1,2 +1,2 @@ get_parms("deny","accept","accept_hd","watermark","template"); +$parm = $request->get_parms("deny", "accept", "accept_hd", "watermark", "template"); -$lng = isset($session->locale)?$session->locale:GV_default_lng; +$lng = isset($session->locale) ? $session->locale : GV_default_lng; -if(isset($session->usr_id) && isset($session->ses_id)) +if (isset($session->usr_id) && isset($session->ses_id)) { - $ses_id = $session->ses_id; - $usr_id = $session->usr_id; - - if(!$session->admin) - { - phrasea::headers(403); - } + $ses_id = $session->ses_id; + $usr_id = $session->usr_id; + + if (!$session->admin) + { + phrasea::headers(403); + } } -else{ - phrasea::headers(403); +else +{ + phrasea::headers(403); } -if(!($ph_session = phrasea_open_session($ses_id,$usr_id))) +if (!($ph_session = phrasea_open_session($ses_id, $usr_id))) { - phrasea::headers(403); + phrasea::headers(403); } $conn = connection::getInstance(); -if(!$conn) +if (!$conn) { - phrasea::headers(500); + phrasea::headers(500); } $allnames = array(); -foreach($ph_session['bases'] as $base) +foreach ($ph_session['bases'] as $base) { - foreach($base['collections'] as $coll) - { - $allnames[$coll['base_id']] = $coll['name']; - - } + foreach ($base['collections'] as $coll) + { + $allnames[$coll['base_id']] = $coll['name']; + } } $templates = array(); -if(!is_null($parm['template'])) +if (!is_null($parm['template'])) { - foreach($parm['template'] as $tmp) - { - if(trim($tmp) != '') - { - $tmp = explode('_',$tmp); - - if(count($tmp) == 2) - { - $templates[$tmp[0]] = $tmp[1]; - } - } - } + foreach ($parm['template'] as $tmp) + { + if (trim($tmp) != '') + { + $tmp = explode('_', $tmp); + + if (count($tmp) == 2) + { + $templates[$tmp[0]] = $tmp[1]; + } + } + } } $deny = $accept = $options = array(); -if(!is_null($parm['deny'])) +if (!is_null($parm['deny'])) { - foreach($parm['deny'] as $den) - { - $den = explode('_',$den); - if(count($den) == 2 && !isset($templates[$den[0]])) - { - $deny[$den[0]][$den[1]]=$den[1]; - } - } + foreach ($parm['deny'] as $den) + { + $den = explode('_', $den); + if (count($den) == 2 && !isset($templates[$den[0]])) + { + $deny[$den[0]][$den[1]] = $den[1]; + } + } } -if(!is_null($parm['accept'])) +if (!is_null($parm['accept'])) { - foreach($parm['accept'] as $acc) - { - $acc = explode('_',$acc); - if(count($acc) == 2 && !isset($templates[$acc[0]])) - { - $accept[$acc[0]][$acc[1]] = $acc[1]; - $options[$acc[0]][$acc[1]]=array('HD'=>false,'WM'=>false); - } - } + foreach ($parm['accept'] as $acc) + { + $acc = explode('_', $acc); + if (count($acc) == 2 && !isset($templates[$acc[0]])) + { + $accept[$acc[0]][$acc[1]] = $acc[1]; + $options[$acc[0]][$acc[1]] = array('HD' => false, 'WM' => false); + } + } } -if(!is_null($parm['accept_hd'])) +if (!is_null($parm['accept_hd'])) { - foreach($parm['accept_hd'] as $accHD) - { - $accHD = explode('_',$accHD); - if(count($accHD) == 2 && isset($accept[$accHD[0]]) && isset($options[$accHD[0]][$accHD[1]])) - { - $options[$accHD[0]][$accHD[1]]['HD'] = true; - } - } + foreach ($parm['accept_hd'] as $accHD) + { + $accHD = explode('_', $accHD); + if (count($accHD) == 2 && isset($accept[$accHD[0]]) && isset($options[$accHD[0]][$accHD[1]])) + { + $options[$accHD[0]][$accHD[1]]['HD'] = true; + } + } } -if(!is_null($parm['watermark'])) +if (!is_null($parm['watermark'])) { - foreach($parm['watermark'] as $wm) - { - $wm = explode('_',$wm); - if(count($wm) == 2 && isset($accept[$wm[0]]) && isset($options[$wm[0]][$wm[1]])) - { - $options[$wm[0]][$wm[1]]['WM'] = true; - } - } + foreach ($parm['watermark'] as $wm) + { + $wm = explode('_', $wm); + if (count($wm) == 2 && isset($accept[$wm[0]]) && isset($options[$wm[0]][$wm[1]])) + { + $options[$wm[0]][$wm[1]]['WM'] = true; + } + } } -if(!is_null($templates) || !is_null($parm['deny']) || !is_null($parm['accept'])) + + +// if(!isset($done[$usr])) +// $done[$usr] = array(); +// +// $done[$usr][$bas] = true; +// + +if (!is_null($templates) || !is_null($parm['deny']) || !is_null($parm['accept'])) { - $done = array(); - - $cache_to_update = array(); - - foreach($templates as $usr=>$template_id) - { - $cache_to_update[$usr] = true; - - $sql = "REPLACE INTO sbasusr (SELECT null as sbasusr_id, sbas_id, '".$conn->escape_string($usr)."' as usr_id, bas_manage, bas_modify_struct, bas_modif_th, bas_chupub FROM sbasusr WHERE usr_id='".$conn->escape_string($template_id)."')"; - $conn->query($sql); - - $sql = "REPLACE INTO basusr (SELECT null as id, base_id, '".$conn->escape_string($usr)."' as usr_id, canpreview, canhd, canputinalbum, candwnldhd, candwnldsubdef, candwnldpreview, cancmd, canadmin, actif, canreport, canpush, creationdate, basusr_infousr, mask_and, mask_xor, restrict_dwnld, month_dwnld_max, remain_dwnld, time_limited, limited_from, limited_to, canaddrecord, canmodifrecord, candeleterecord, chgstatus, lastconn, imgtools, manage, modify_struct, bas_manage, bas_modify_struct, needwatermark FROM basusr WHERE usr_id='".$conn->escape_string($template_id)."')"; - if($conn->query($sql)) - { - if(!isset($done[$usr])) - $done[$usr] = array(); - - $sql = 'SELECT base_id FROM basusr WHERE usr_id = "'.$conn->escape_string($template_id).'" AND base_id NOT IN (SELECT base_id FROM basusr WHERE usr_id = "'.$conn->escape_string($usr).'")'; - if($rs = $conn->query($sql)) - { - while($row = $conn->fetch_assoc($rs)) - { - $done[$usr][$row['base_id']] = true; - } - } - - $sql = "DELETE FROM demand WHERE usr_id='".$conn->escape_string($usr)."'"; - $conn->query($sql); - - $sql = "SELECT usr_login as lastModel from usr where usr_id='".$conn->escape_string($template_id)."'"; - if($rs = $conn->query($sql)) - { - if($row = $conn->fetch_assoc($rs)) - { - $sql = "UPDATE usr SET lastModel = '".$conn->escape_string($row['lastModel'])."' WHERE usr_id = '".$conn->escape_string($usr)."' "; - $conn->query($sql); - } - } - } - } - foreach($deny as $usr=>$bases) - { - $cache_to_update[$usr] = true; - foreach($bases as $bas) - { - $sql = "UPDATE demand SET en_cours=0,refuser=1,date_modif=now() WHERE usr_id='".$conn->escape_string($usr)."' AND base_id='".$conn->escape_string($bas)."'"; - - if($conn->query($sql)) - { - - if(!isset($done[$usr])) - $done[$usr] = array(); - - $done[$usr][$bas] = false; - } - } - } - foreach($accept as $usr=>$bases) - { - $cache_to_update[$usr] = true; - foreach($bases as $bas) - { - $sql = "INSERT INTO sbasusr (sbas_id,usr_id,bas_manage, bas_modify_struct) VALUES ('".$conn->escape_string(phrasea::sbasFromBas($bas))."','".$conn->escape_string($usr)."','0','0')"; - $conn->query($sql); - - $wm = $options[$usr][$bas]['WM']; - $hd = $options[$usr][$bas]['HD']; - $f = $v = ''; - $f.="base_id,"; $v.="$bas,"; - $f.="usr_id,"; $v.="$usr,"; - $f.="canpreview,"; $v.="1,"; - $f.="canhd,"; $v.="0,"; - $f.="canputinalbum,"; $v.="1,"; - - if($hd) - { $f.="candwnldhd,"; $v.="1,"; } - else - { $f.="candwnldhd,"; $v.="0,"; } - - if($wm) - { $f.="needwatermark,"; $v.="1,"; } - else - { $f.="needwatermark,"; $v.="0,"; } - - $f.="candwnldsubdef,"; $v.="0,"; - $f.="candwnldpreview,"; $v.="1,"; - $f.="cancmd,"; $v.="0,"; - $f.="canadmin,"; $v.="0,"; - $f.="actif,"; $v.="1,"; - $f.="canreport,"; $v.="0,"; - $f.="canpush,"; $v.="0,"; - $f.="creationdate,"; $v.="now(),"; - $f.="basusr_infousr,"; $v.="'',"; - $f.="mask_and,"; $v.="0,"; - $f.="mask_xor,"; $v.="0,"; - $f.="restrict_dwnld,"; $v.="0,"; - $f.="month_dwnld_max,"; $v.="0,"; - $f.="remain_dwnld,"; $v.="0,"; - $f.="time_limited,"; $v.="0,"; - $f.="canaddrecord,"; $v.="0,"; - $f.="canmodifrecord,"; $v.="0,"; - $f.="candeleterecord"; $v.="0"; - - $sql = "INSERT INTO basusr ( $f ) VALUES ( $v )"; - $conn->query($sql); - - if(!isset($done[$usr])) - $done[$usr] = array(); - - $done[$usr][$bas] = true; - - $sql = "DELETE FROM demand WHERE usr_id='".$conn->escape_string($usr)."' AND base_id='".$conn->escape_string($bas)."'"; - $conn->query($sql); - } - } - - $cache_user = cache_user::getInstance(); - foreach($cache_to_update as $usr_id=>$true) - $cache_user->delete($usr_id); - - foreach($done as $usr=>$bases) - { - $sql = 'SELECT usr_mail FROM usr WHERE usr_id = "'.$conn->escape_string($usr).'"'; - $accept = $deny = ''; - if($rs = $conn->query($sql)) - { - if($row = $conn->fetch_assoc($rs)) - { - if(p4string::checkMail($row['usr_mail'])) - { - foreach($bases as $bas=>$isok) - { - if(isset($allnames[$bas])) - { - if($isok === true) - $accept .= '
  • '.$allnames[$bas]."
  • \n"; - if($isok === false) - $deny .= '
  • '.$allnames[$bas]."
  • \n"; - } - } - } - - if(($accept != '' || $deny != '')) - { - mail::register_confirm($row['usr_mail'], $accept, $deny); - } - } - } - } + $done = array(); + + $cache_to_update = array(); + + foreach ($templates as $usr => $template_id) + { + $cache_to_update[$usr] = true; + + $sql = 'SELECT distinct base_id FROM basusr WHERE usr_id="' . $conn->escape_string($template_id) . '" AND actif="1"'; + if ($rs = $conn->query($sql)) + { + while ($row = $conn->fetch_assoc($rs)) + { + if (!isset($done[$usr])) + $done[$usr] = array(); + + $done[$usr][$row['base_id']] = true; + } + $conn->free_result($rs); + } + + $sql = "REPLACE INTO sbasusr (SELECT null as sbasusr_id, sbas_id, '" . $conn->escape_string($usr) . "' as usr_id, bas_manage, bas_modify_struct, bas_modif_th, bas_chupub FROM sbasusr WHERE usr_id='" . $conn->escape_string($template_id) . "')"; + $conn->query($sql); + + $sql = "REPLACE INTO basusr (SELECT null as id, base_id, '" . $conn->escape_string($usr) . "' as usr_id, canpreview + , canhd, canputinalbum, candwnldhd, candwnldsubdef, candwnldpreview, cancmd + , canadmin, actif, canreport, canpush, creationdate, basusr_infousr, mask_and, mask_xor + , restrict_dwnld, month_dwnld_max, remain_dwnld, time_limited, limited_from, limited_to + , canaddrecord, canmodifrecord, candeleterecord, chgstatus, lastconn, imgtools, manage + , modify_struct, bas_manage, bas_modify_struct, needwatermark FROM basusr + WHERE usr_id='" . $conn->escape_string($template_id) . "')"; + if ($conn->query($sql)) + { + if (!isset($done[$usr])) + $done[$usr] = array(); + + $sql = 'SELECT base_id FROM basusr WHERE usr_id = "' . $conn->escape_string($template_id) . '" AND base_id NOT IN (SELECT base_id FROM basusr WHERE usr_id = "' . $conn->escape_string($usr) . '")'; + if ($rs = $conn->query($sql)) + { + while ($row = $conn->fetch_assoc($rs)) + { + $done[$usr][$row['base_id']] = true; + } + } + + $sql = "DELETE FROM demand WHERE usr_id='" . $conn->escape_string($usr) . "'"; + $conn->query($sql); + + $sql = "SELECT usr_login as lastModel from usr where usr_id='" . $conn->escape_string($template_id) . "'"; + if ($rs = $conn->query($sql)) + { + if ($row = $conn->fetch_assoc($rs)) + { + $sql = "UPDATE usr SET lastModel = '" . $conn->escape_string($row['lastModel']) . "' WHERE usr_id = '" . $conn->escape_string($usr) . "' "; + $conn->query($sql); + } + } + } + } + foreach ($deny as $usr => $bases) + { + $cache_to_update[$usr] = true; + foreach ($bases as $bas) + { + $sql = "UPDATE demand SET en_cours=0,refuser=1,date_modif=now() WHERE usr_id='" . $conn->escape_string($usr) . "' AND base_id='" . $conn->escape_string($bas) . "'"; + + if ($conn->query($sql)) + { + + if (!isset($done[$usr])) + $done[$usr] = array(); + + $done[$usr][$bas] = false; + } + } + } + foreach ($accept as $usr => $bases) + { + $cache_to_update[$usr] = true; + foreach ($bases as $bas) + { + $sql = "INSERT INTO sbasusr (sbas_id,usr_id,bas_manage, bas_modify_struct) VALUES ('" . $conn->escape_string(phrasea::sbasFromBas($bas)) . "','" . $conn->escape_string($usr) . "','0','0')"; + $conn->query($sql); + + $wm = $options[$usr][$bas]['WM']; + $hd = $options[$usr][$bas]['HD']; + $f = $v = ''; + $f.="base_id,"; + $v.="$bas,"; + $f.="usr_id,"; + $v.="$usr,"; + $f.="canpreview,"; + $v.="1,"; + $f.="canhd,"; + $v.="0,"; + $f.="canputinalbum,"; + $v.="1,"; + + if ($hd) + { + $f.="candwnldhd,"; + $v.="1,"; + } + else + { + $f.="candwnldhd,"; + $v.="0,"; + } + + if ($wm) + { + $f.="needwatermark,"; + $v.="1,"; + } + else + { + $f.="needwatermark,"; + $v.="0,"; + } + + $f.="candwnldsubdef,"; + $v.="0,"; + $f.="candwnldpreview,"; + $v.="1,"; + $f.="cancmd,"; + $v.="0,"; + $f.="canadmin,"; + $v.="0,"; + $f.="actif,"; + $v.="1,"; + $f.="canreport,"; + $v.="0,"; + $f.="canpush,"; + $v.="0,"; + $f.="creationdate,"; + $v.="now(),"; + $f.="basusr_infousr,"; + $v.="'',"; + $f.="mask_and,"; + $v.="0,"; + $f.="mask_xor,"; + $v.="0,"; + $f.="restrict_dwnld,"; + $v.="0,"; + $f.="month_dwnld_max,"; + $v.="0,"; + $f.="remain_dwnld,"; + $v.="0,"; + $f.="time_limited,"; + $v.="0,"; + $f.="canaddrecord,"; + $v.="0,"; + $f.="canmodifrecord,"; + $v.="0,"; + $f.="candeleterecord"; + $v.="0"; + + $sql = "INSERT INTO basusr ( $f ) VALUES ( $v )"; + $conn->query($sql); + + if (!isset($done[$usr])) + $done[$usr] = array(); + + $done[$usr][$bas] = true; + + $sql = "DELETE FROM demand WHERE usr_id='" . $conn->escape_string($usr) . "' AND base_id='" . $conn->escape_string($bas) . "'"; + $conn->query($sql); + } + } + + $cache_user = cache_user::getInstance(); + foreach ($cache_to_update as $usr_id => $true) + $cache_user->delete($usr_id); + + foreach ($done as $usr => $bases) + { + $sql = 'SELECT usr_mail FROM usr WHERE usr_id = "' . $conn->escape_string($usr) . '"'; + $accept = $deny = ''; + if ($rs = $conn->query($sql)) + { + if ($row = $conn->fetch_assoc($rs)) + { + if (p4string::checkMail($row['usr_mail'])) + { + foreach ($bases as $bas => $isok) + { + if (isset($allnames[$bas])) + { + if ($isok === true) + $accept .= '
  • ' . $allnames[$bas] . "
  • \n"; + if ($isok === false) + $deny .= '
  • ' . $allnames[$bas] . "
  • \n"; + } + } + } + + if (($accept != '' || $deny != '')) + { + mail::register_confirm($row['usr_mail'], $accept, $deny); + } + } + } + } } phrasea::headers(); ?> - - - - - - - + + - + function checkAll(that) + { + var bool = true; + var first = true; + $('.'+that+'_checker:not(:disabled)').each(function(){ + // if(!$(this)[0].disabled) + // { + if(first && $(this)[0].checked) + bool = false; + $(this)[0].checked = bool; + first = false; + if(that == 'deny') + { + checkDeny($(this)); + } + if(that == 'accept_hd') + checkAdd(this) + if(that == 'watermark') + checkAdd(this) + if(that == 'accept') + checkRemove(this) + // } + }); + } + + - - -
    - - -$out = ""; + + + query($sql); + $sql = "delete from demand where date_modif <'" . date('Y-m-d', $lastMonth) . "'"; + $conn->query($sql); // on filtre les bases administrables -$sql = "SELECT base_id FROM basusr WHERE usr_id='".$conn->escape_string($session->usr_id)."' AND canadmin=1"; + $sql = "SELECT base_id FROM basusr WHERE usr_id='" . $conn->escape_string($session->usr_id) . "' AND canadmin=1"; - $baslist = array(); - if($rs = $conn->query($sql)) - { - while($row = $conn->fetch_assoc($rs)) - { - $baslist[] = $row["base_id"]; - } - $conn->free_result($rs); - } + $baslist = array(); + if ($rs = $conn->query($sql)) + { + while ($row = $conn->fetch_assoc($rs)) + { + $baslist[] = $row["base_id"]; + } + $conn->free_result($rs); + } - $models = ''; - $sql = 'SELECT usr_id, usr_login FROM usr WHERE model_of = "'.$conn->escape_string($session->usr_id).'"'; - if($rs = $conn->query($sql)) - { - while($row = $conn->fetch_assoc($rs)) - $models .= ''; - } - - $sql = "SELECT demand.date_modif,demand.base_id,usr.usr_id , usr.usr_login ,usr.usr_nom,usr.usr_prenom, usr.societe,CONCAT(usr.usr_nom,' ',usr.usr_prenom,'\n',fonction,' (',societe,')') AS info + $models = ''; + $sql = 'SELECT usr_id, usr_login FROM usr WHERE model_of = "' . $conn->escape_string($session->usr_id) . '"'; + if ($rs = $conn->query($sql)) + { + while ($row = $conn->fetch_assoc($rs)) + $models .= ''; + } + + $sql = "SELECT demand.date_modif,demand.base_id,usr.usr_id , usr.usr_login ,usr.usr_nom,usr.usr_prenom, usr.societe,CONCAT(usr.usr_nom,' ',usr.usr_prenom,'\n',fonction,' (',societe,')') AS info FROM (demand INNER JOIN usr on demand.usr_id=usr.usr_id AND demand.en_cours=1) - WHERE (base_id='" . implode("' OR base_id='",$baslist) ."') ORDER BY demand.usr_id DESC,demand.base_id ASC"; - - //$out .= '
    '.$baslibs . "
    "; + WHERE (base_id='" . implode("' OR base_id='", $baslist) . "') ORDER BY demand.usr_id DESC,demand.base_id ASC"; - if($rs = $conn->query($sql)) - { + //$out .= '
    '.$baslibs . "
    "; - $out .= "
    "; - $out .= "
    "._('admin:: demandes en cours')."
    "; - - $out .= "
    "; - $out .= "". - "". - "". - "". - "". - "". - "". - "". - "". - "". - "". - "
    HDW" . _('admin::compte-utilisateur identifiant') . "" . _('admin::compte-utilisateur societe') . "" . _('admin::compte-utilisateur date d\'inscription') . ""._('admin::collection')."
    "; - - - $out .= "
    "; - $out .= "
    "; - $out .= "". - "". - "". - "". - "". - "". - "". - "". - "". - "". - ""; - $class = ''; - $currentUsr = null; - while(($row = $conn->fetch_assoc($rs))) - { - if($row['usr_id'] != $currentUsr) - { - if($currentUsr !== null) - { - - $out .= '
    '; - } - - $currentUsr = $row['usr_id']; - $class = $class=='g'?'':'g'; - - $info = "" ; - $sqlInfo = "SELECT * FROM usr WHERE usr_id='".$conn->escape_string($row['usr_id'])."'"; - if($rsInfo = $conn->query($sqlInfo)) - { - if($rowInfo = $conn->fetch_assoc($rsInfo)) - { - $info .= "
    " . _('admin::compte-utilisateur identifiant') . " : " . ($rowInfo["usr_login"]) ."
    "; - - $info .= "
    ". _('admin::compte-utilisateur nom') . "/" . _('admin::compte-utilisateur prenom') . " : " ; - $info .= ($rowInfo["usr_nom"]) ." "; - $info .= ($rowInfo["usr_prenom"]); - $info .= "
    "; - - $info .= "
    ". _('admin::compte-utilisateur email') . " : " ; - $info .= ($rowInfo["usr_mail"]) ; - $info .= "
    "; - - $info .= "
    ". _('admin::compte-utilisateur telephone') . " : " ; - $info .= ($rowInfo["tel"]) ; - $info .= "
    "; - - $info .= "
    ". _('admin::compte-utilisateur poste') . " : " ; - $info .= ($rowInfo["fonction"]) ; - $info .= "
    "; - - $info .= "
    ". _('admin::compte-utilisateur societe') . " : " ; - $info .= ($rowInfo["societe"]) ; - $info .= "
    "; - - $info .= "
    ". _('admin::compte-utilisateur activite') . " : " ; - $info .= ($rowInfo["activite"]) ; - $info .= "
    "; - - $info .= "
    " . _('admin::compte-utilisateur adresse'). " : "; - $info .= "". ($rowInfo["adresse"]); - $info .= "
    "; - - $info .= "
    "; - - $info .= ($rowInfo["cpostal"])." "; - - $info .= ($rowInfo["ville"]); - $info .= "
    ". "
    "; - - } - } - - $info = "
    ".$info."
    "; - - - $out .= '' ; - $out .= ""; - $out .= " "; - $out .= ""; - $out .= ""; - $out .= " "; - $out .= ""; - $out .= ""; - $out .= " "; - $out .= ""; - $out .= ""; - $out .= " "; - $out .= ""; - $out .= ''; - $out .= '' . ($row["usr_login"]) ; - $out .= '' ; - - $tmp = $row["usr_nom"]." ".$row["usr_prenom"].( $row["societe"]?" (".$row["societe"].")":"" ); - $out .= '' . ( trim($tmp) ). '' ; - - $out .= ' '._('admin:: appliquer le modele ').' '; - - $out .= ''; - $out .= '
    '. - "". - "". - "". - "". - "". - "". - "". - "". - "". - ""; - - } + if ($rs = $conn->query($sql)) + { - $out .= '' ; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= ""; - - $out .= '' ; - - if(isset($allnames[$row["base_id"]])) - $out .= ''; - else - $out .= ''; - - $out .= ''; - } - - $out .= "
    "; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= ""; - $out .= "' . ($row["date_modif"]) . '' . $allnames[$row["base_id"]]. '' . $row["base_id"] . '

    \n"; - $out .= "
    \n"; - - $out .= ""; - - $out .= ""; + $out .= "
    "; + $out .= "
    " . _('admin:: demandes en cours') . "
    "; - } - $conn->free_result($rs); + $out .= "
    "; + $out .= "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "
    HDW" . _('admin::compte-utilisateur identifiant') . "" . _('admin::compte-utilisateur societe') . "" . _('admin::compte-utilisateur date d\'inscription') . "" . _('admin::collection') . "
    "; - $out .= "
    "; - $out .= "
    "; - $out .= " "; - $out .= "
    "; - $out .= "
    "; - $out .= " "; - $out .= ""; -print($out); + $out .= "
    "; + $out .= "
    "; + $out .= "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + ""; + $class = ''; + $currentUsr = null; + while (($row = $conn->fetch_assoc($rs))) + { + if ($row['usr_id'] != $currentUsr) + { + if ($currentUsr !== null) + { -?> - - + $out .= '
    '; + } + + $currentUsr = $row['usr_id']; + $class = $class == 'g' ? '' : 'g'; + + $info = ""; + $sqlInfo = "SELECT * FROM usr WHERE usr_id='" . $conn->escape_string($row['usr_id']) . "'"; + if ($rsInfo = $conn->query($sqlInfo)) + { + if ($rowInfo = $conn->fetch_assoc($rsInfo)) + { + $info .= "
    " . _('admin::compte-utilisateur identifiant') . " : " . ($rowInfo["usr_login"]) . "
    "; + + $info .= "
    " . _('admin::compte-utilisateur nom') . "/" . _('admin::compte-utilisateur prenom') . " : "; + $info .= ( $rowInfo["usr_nom"]) . " "; + $info .= ( $rowInfo["usr_prenom"]); + $info .= "
    "; + + $info .= "
    " . _('admin::compte-utilisateur email') . " : "; + $info .= ( $rowInfo["usr_mail"]); + $info .= "
    "; + + $info .= "
    " . _('admin::compte-utilisateur telephone') . " : "; + $info .= ( $rowInfo["tel"]); + $info .= "
    "; + + $info .= "
    " . _('admin::compte-utilisateur poste') . " : "; + $info .= ( $rowInfo["fonction"]); + $info .= "
    "; + + $info .= "
    " . _('admin::compte-utilisateur societe') . " : "; + $info .= ( $rowInfo["societe"]); + $info .= "
    "; + + $info .= "
    " . _('admin::compte-utilisateur activite') . " : "; + $info .= ( $rowInfo["activite"]); + $info .= "
    "; + + $info .= "
    " . _('admin::compte-utilisateur adresse') . " : "; + $info .= "" . ($rowInfo["adresse"]); + $info .= "
    "; + + $info .= "
    "; + + $info .= ( $rowInfo["cpostal"]) . " "; + + $info .= ( $rowInfo["ville"]); + $info .= "
    " . "
    "; + } + } + + $info = "
    " . $info . "
    "; + + + $out .= ''; + $out .= ""; + $out .= " "; + $out .= ""; + $out .= ""; + $out .= " "; + $out .= ""; + $out .= ""; + $out .= " "; + $out .= ""; + $out .= ""; + $out .= " "; + $out .= ""; + $out .= ''; + $out .= '' . ($row["usr_login"]); + $out .= ''; + + $tmp = $row["usr_nom"] . " " . $row["usr_prenom"] . ( $row["societe"] ? " (" . $row["societe"] . ")" : "" ); + $out .= '' . ( trim($tmp) ) . ''; + + $out .= ' ' . _('admin:: appliquer le modele ') . ' '; + + $out .= ''; + $out .= '
    ' . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + "" . + ""; + } + + $out .= ''; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= ""; + + $out .= ''; + + if (isset($allnames[$row["base_id"]])) + $out .= ''; + else + $out .= ''; + + $out .= ''; + } + + $out .= "
    "; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= ""; + $out .= "' . ($row["date_modif"]) . '' . $allnames[$row["base_id"]] . '' . $row["base_id"] . '

    \n"; + $out .= "
    \n"; + + $out .= ""; + + $out .= ""; + } + $conn->free_result($rs); + + $out .= "
    "; + $out .= "
    "; + $out .= " "; + $out .= "
    "; + $out .= "
    "; + $out .= " "; + $out .= ""; + + print($out); + ?> + + diff --git a/www/lightbox/jquery.lightbox.ie6.js b/www/lightbox/jquery.lightbox.ie6.js index 4d65154a39..508e1ee636 100644 --- a/www/lightbox/jquery.lightbox.ie6.js +++ b/www/lightbox/jquery.lightbox.ie6.js @@ -429,14 +429,14 @@ function display_basket_element(compare, sselcont_id) { if(compare) { - $('.agreement_selector').show(); +// $('.agreement_selector').show(); $('#record_infos, #right_column').hide(); $('#record_wrapper').stop().css({width:'100%'}); display_record(compare); } else { - $('.agreement_selector').hide(); +// $('.agreement_selector').hide(); $('#record_wrapper').css({width:($('#innerWrapper').width() - $('#record_infos').outerWidth() - $('#right_column').outerWidth() - 2)}); display_record(compare); $('#record_infos, #right_column').show(); @@ -558,6 +558,7 @@ function display_record(compare) if(compare) { + $('.agreement_selector').show(); main_container.addClass('comparison'); var double_portrait_width = main_container_innerwidth / 2; @@ -673,6 +674,7 @@ function display_record(compare) } else { + $('.agreement_selector').hide(); main_container.removeClass('comparison'); if(compare_box.is(':visible')) diff --git a/www/lightbox/jquery.lightbox.js b/www/lightbox/jquery.lightbox.js index 972f66677c..80726f0042 100644 --- a/www/lightbox/jquery.lightbox.js +++ b/www/lightbox/jquery.lightbox.js @@ -520,7 +520,7 @@ function display_basket_element(compare, sselcont_id) { if(compare) { - $('.agreement_selector').show(); +// $('.agreement_selector').show(); // $('#record_wrapper').stop().animate({right:0},100,function(){display_record(compare);}); $('#record_wrapper').css({right:0}); display_record(compare); @@ -528,7 +528,7 @@ function display_basket_element(compare, sselcont_id) } else { - $('.agreement_selector').hide(); +// $('.agreement_selector').hide(); $('#record_wrapper').css({right:250}); display_record(compare); $('#right_column').show(); @@ -810,6 +810,7 @@ function display_record(compare) if(compare) { + $('.agreement_selector').show(); main_container.addClass('comparison'); var double_portrait_width = main_container_innerwidth / 2; @@ -926,6 +927,7 @@ function display_record(compare) } else { + $('.agreement_selector').hide(); main_container.removeClass('comparison'); if(compare_box.is(':visible')) diff --git a/www/login/register.php b/www/login/register.php index 0727514488..279633275c 100644 --- a/www/login/register.php +++ b/www/login/register.php @@ -73,7 +73,7 @@ if($request->has_post_datas()) foreach($parm as $field=>$value) { - if(is_string($value) && isset($arrayVerif[$field])) + if(is_string($value) && isset($arrayVerif[$field]) && $arrayVerif[$field] === true) { if(trim($value) == '' ) $needed[$field] = _('forms::ce champ est requis'); @@ -340,6 +340,9 @@ phrasea::headers(); $first = true; $sep = $msg = $rules = ''; foreach($arrayVerif as $ar=>$ver) + { + if($ver === false) + continue; if($ar != 'form_password') { if(!$first) @@ -361,6 +364,7 @@ phrasea::headers(); $msg .= '}'; } + } ?> @@ -445,7 +449,7 @@ phrasea::headers(); @@ -458,7 +462,7 @@ phrasea::headers(); @@ -507,19 +511,6 @@ phrasea::headers();   - - - - - - " value="" class="input_element geoname_field" name="form_geonameid"> - - - - - : @@ -533,6 +524,19 @@ phrasea::headers(); + + + + + + " class="input_element" name="form_firstname"> + + + + +