Re: [gepi-users] Re: --- IMPORTANT :Sécurité Gepi --- Nouvelle version 1.4.1, ---

Bourdelle Alain alain.bourdelle at ac-limoges.fr
Mar 14 Mar 12:36:46 CET 2006


Bonjour,
Je vous envoie les fichiers.
Effectivement,quand j'ouvre des fichiers inc ou php récupérés par FTP 
sur le serveur, j'ai une seule ligne, alors je les reprends avec 
Wordpad et je les transfère à  nouveau sur le serveur. Et Gepi 
fonctionne.
AB 

---- Messages d´origine ----
De: Laurent Delineau <laurent.delineau at ac-poitiers.fr>
Date: Mardi, Mars 14, 2006 10:41 am
Objet: Re: [gepi-users] Re: --- IMPORTANT :Sécurité Gepi --- Nouvelle 
version 1.4.1,      ---

> Bourdelle Alain a écrit :
> > Bonjour,
> > 
> > J'ai envoyé à mon hébergeur du site gepi le message erreur  
> Fatal 
> > error: Call to undefined function: minicals() in  
> > gepi/mod_absences/gestion_absences.php on line 1148.
> > En retour,  il m'envoie ce message.
> > Le problème vient de la mise à jour de Gepi, certains fichiers 
> comme 
> > create_im_mat.php ou encore mincals_absences.inc on été mal encodés
> > par les développeurs Gepi (conversion dos/unix).
> > Il a corrigé les fichiers à la main et plus de problème.
> > 
> > AB
> 
> Euh, ce serait sympa de savoir ce qui a été corrigé, non ?
> 
> Laurent Delineau,
> Un développeur GEPI ;-)
> 
> _______________________________________________
> gepi-users mailing list
> gepi-users at lists.adullact.net
> https://lists.adullact.net/mailman/listinfo/gepi-users
> 
-------------- section suivante --------------
Une pièce jointe non texte a été nettoyée...
Nom: create_im_mat.php
Type: application/octet-stream
Taille: 2826 octets
Desc: non disponible
Url: http://lists.adullact.net/pipermail/gepi-users/attachments/20060314/89429544/create_im_mat.obj
-------------- section suivante --------------
<?php

// $Id$

function minicals($year, $month, $day, $id_classe, $type, $dmy) {

// PHP Calendar Class
//
// Copyright David Wilkinson 2000. All Rights reserved.
//
// This software may be used, modified and distributed freely
// providing this copyright notice remains intact at the head
// of the file.
//
// This software is freeware. The author accepts no liability for
// any loss or damages whatsoever incurred directly or indirectly
// from the use of this script.
//
// URL:   http://www.cascade.org.uk/software/php/calendar/
// Email: davidw at cascade.org.uk

class Calendar
{
    var $month;
    var $year;
    var $day;
    var $h;
    var $id_classe;
    var $type;
    var $dmy;

    function Calendar($day, $month, $year, $h, $id_classe, $type, $dmy)
    {
        $this->day   = $day;
        $this->month = $month;
        $this->year  = $year;
        $this->h     = $h;
        $this->id_classe  = $id_classe;
    $this->type  = $type;
    $this->dmy   = $dmy;
    }


    function getCalendarLink($month, $year, $id_classe, $type)
    {
        $day=1;
    if ($this->dmy=='gestion_absences') return $this->dmy.".php?year=$year&month=$month&day=$day&id_classe=$id_classe&type=$type";
    }

   function getDateLink($day, $month, $year) {
    global $vocab;
      if ($this->dmy=='gestion_absences') return "<a title=\"Voir le cahier de texte pour cette journée\" href=".$this->dmy.".php?year=$year&month=$month&day=$day&id_classe=".$this->id_classe."&type=".$this->type;


   }


    function getDaysInMonth($month, $year)
    {
        if ($month < 1 || $month > 12)
        {
            return 0;
        }

        $days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

        $d = $days[$month - 1];

        if ($month == 2)
        {
            // Check for leap year
            // Forget the 4000 rule, I doubt I'll be around then...

            if ($year%4 == 0)
            {
                if ($year%100 == 0)
                {
                    if ($year%400 == 0)
                    {
                        $d = 29;
                    }
                }
                else
                {
                    $d = 29;
                }
            }
        }

        return $d;
    }

    function getFirstDays()
    {
      global $weekstarts;

      $basetime = mktime(12,0,0,6,11+$weekstarts,2000);
      for ($i = 0, $s = ""; $i < 7; $i++)
      {
         $show = $basetime + ($i * 24 * 60 * 60);
         $fl = strftime('%a',$show);
         $s .= "<td align=center valign=top class=\"calendarHeader\">$fl</td>\n";
      }
      return $s;
    }

    function getHTML()
    {
        global $weekstarts;
    global $vocab;
        if (!isset($weekstarts)) $weekstarts = 0;
        $s = "";

        $daysInMonth = $this->getDaysInMonth($this->month, $this->year);
        $date = mktime(12, 0, 0, $this->month, 1, $this->year);

        $first = (strftime("%w",$date) + 7 - $weekstarts) % 7;
        $monthName = strftime("%B",$date);

        $prevMonth = $this->getCalendarLink($this->month - 1 >   0 ? $this->month - 1 : 12, $this->month - 1 >   0 ? $this->year : $this->year - 1, $this->id_classe, $this->type);
        $nextMonth = $this->getCalendarLink($this->month + 1 <= 12 ? $this->month + 1 :  1, $this->month + 1 <= 12 ? $this->year : $this->year + 1, $this->id_classe, $this->type);

        $s .= "<table class=\"calendar\" style=\"margin:auto\"border=1>\n";
        $s .= "<tr><td class=\"calendarcol1\" align=right valign=top></td>\n";
        $s .= "<td align=center valign=top class=\"calendarHeader\">" . (($prevMonth == "") ? "&nbsp;" : "<a href=\"$prevMonth\">&lt;&lt;</a>")  . "</td>\n";
        $s .= "<td align=center valign=top class=\"calendarHeader\" colspan=5>";

    if ($this->dmy!='gestion_absences') {
        $s .= "<a href=\"month.php?year=$this->year&month=$this->month&day=1&id_classe=$this->id_classe&type=$this->type\">$monthName&nbsp;$this->year</a>";
    } else {
        $s .= "$monthName&nbsp;$this->year";
    }

    $s .= "</td>\n";
        $s .= "<td align=center valign=top class=\"calendarHeader\">" . (($nextMonth == "") ? "&nbsp;" : "<a href=\"$nextMonth\">&gt;&gt;</a>")  . "</td>\n";
        $s .= "</tr>\n";

        $s .= "<tr><td  class=\"calendarcol1\" align=right valign=top></td>\n";
        $s .= $this->getFirstDays();
        $s .= "</tr>\n";

        $d = 1 - $first;
        $temp = 1;
    $numweek=1;
        while ($d <= $daysInMonth)
        {
        $s .= "<tr><td class=\"calendarcol1\" align=right valign=top>";
        if ($this->dmy!='gestion_absences') {
                $s .="<a href=\"week.php?year=$this->year&month=$this->month&day=$temp&id_classe=$this->id_classe&type=$this->type\">s".$numweek."</a>";
            $temp=$temp+7;
        $numweek++;
            }
            $s .= "</td>\n";
            for ($i = 0; $i < 7; $i++)
            {
                $s .= "<td class=\"calendar\" align=right valign=top>";
                if ($d > 0 && $d <= $daysInMonth)
                {
                    $link = $this->getDateLink($d, $this->month, $this->year);
                    if ($link == "")
                        $s .= $d;
                    elseif (($d == $this->day) and ($this->h))
                        $s .= $link."><span class=\"cal_current_day\">$d</span></a>";
                    else
                        $s .= $link.">$d</a>";
                }
                else
                {
                    $s .= "&nbsp;";
                }
                $s .= "</td>\n";
                $d++;
            }
            $s .= "</tr>\n";
        }

        $s .= "</table>\n";

        return $s;
    }
}

$thismonth = mktime(0, 0, 0, $month,   $day, $year);




$cal = new Calendar(date("d",$thismonth), date("m",$thismonth), date("Y",$thismonth), 1, $id_classe, $type, $dmy);
echo $cal->getHTML();

}
?>



Plus d'informations sur la liste de diffusion gepi-users