Overview
Comment:Correction bugs sur la page "mes infos" signalés par @arf
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 86f63ea383a918316e8d7ebdad371ae7175e6fbc
User & Date: bohwaz on 2013-04-08 14:24:29
Other Links: manifest | tags
Context
2013-04-08
14:28
Correction bug champs checkbox qui ne sont pas cochables signalé par @arf check-in: fe2d81f9d1 user: bohwaz tags: trunk
14:24
Correction bugs sur la page "mes infos" signalés par @arf check-in: 86f63ea383 user: bohwaz tags: trunk
2013-04-07
04:22
Release 0.5.1 pour correction de bug check-in: a626df96e4 user: bohwaz tags: trunk, 0.5.1
Changes

Modified include/class.membres.php from [e9fd700c86] to [aac365d475].

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
        }

        return utils::mail($dest, $sujet, $message, array('From' => $from));
    }

    // Gestion des données ///////////////////////////////////////////////////////

    public function _checkFields(&$data, $check_mandatory = true)
    {
        $champs = Config::getInstance()->get('champs_membres');

        foreach ($champs->getAll() as $key=>$config)
        {
            if (!isset($data[$key]) || empty($data[$key]) || (!is_array($data[$key]) && trim($data[$key]) == ''))
            {
                if (!empty($config['mandatory']) && $check_mandatory)
                {
                    throw new UserException('Le champ "' . $config['title'] . '" doit obligatoirement être renseigné.');
                }
                elseif (!empty($config['mandatory']))
                {
                    continue;
                }







|







|







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
        }

        return utils::mail($dest, $sujet, $message, array('From' => $from));
    }

    // Gestion des données ///////////////////////////////////////////////////////

    public function _checkFields(&$data, $check_mandatory = true, $check_password = true)
    {
        $champs = Config::getInstance()->get('champs_membres');

        foreach ($champs->getAll() as $key=>$config)
        {
            if (!isset($data[$key]) || empty($data[$key]) || (!is_array($data[$key]) && trim($data[$key]) == ''))
            {
                if (!empty($config['mandatory']) && $check_mandatory && ($check_password || $key != 'passe'))
                {
                    throw new UserException('Le champ "' . $config['title'] . '" doit obligatoirement être renseigné.');
                }
                elseif (!empty($config['mandatory']))
                {
                    continue;
                }
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
        $db = DB::getInstance();

        if (isset($data['id']) && ($data['id'] == $id || empty($data['id'])))
        {
            unset($data['id']);
        }

        $this->_checkFields($data, $check_mandatory);

        if (!empty($data['email'])
            && $db->simpleQuerySingle('SELECT 1 FROM membres WHERE email = ? AND id != ? LIMIT 1;', false, $data['email'], (int)$id))
        {
            throw new UserException('Cette adresse e-mail est déjà utilisée par un autre membre, il faut en choisir une autre.');
        }








|







366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
        $db = DB::getInstance();

        if (isset($data['id']) && ($data['id'] == $id || empty($data['id'])))
        {
            unset($data['id']);
        }

        $this->_checkFields($data, $check_mandatory, false);

        if (!empty($data['email'])
            && $db->simpleQuerySingle('SELECT 1 FROM membres WHERE email = ? AND id != ? LIMIT 1;', false, $data['email'], (int)$id))
        {
            throw new UserException('Cette adresse e-mail est déjà utilisée par un autre membre, il faut en choisir une autre.');
        }

Modified www/admin/mes_infos.php from [ee56d13ace] to [e52bd07e77].

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        $error = 'La vérification ne correspond pas au mot de passe.';
    }
    else
    {
        try {
            $data = array();

            foreach ($config->get('champs_modifiables_membre') as $champ)
            {
                $data[$champ] = utils::post($champ);
            }

            if (utils::post('passe') == '')
            {
                unset($data['passe']);
            }

            $data['lettre_infos'] = utils::post('lettre_infos');

            $membres->edit($membre['id'], $data);
            $membres->updateSessionData();

            utils::redirect('/admin/');
        }
        catch (UserException $e)







|

|

<
<
<
<
<
<
<







23
24
25
26
27
28
29
30
31
32
33







34
35
36
37
38
39
40
        $error = 'La vérification ne correspond pas au mot de passe.';
    }
    else
    {
        try {
            $data = array();

            foreach ($config->get('champs_membres')->getAll() as $key=>$c)
            {
                $data[$key] = utils::post($key);
            }








            $membres->edit($membre['id'], $data);
            $membres->updateSessionData();

            utils::redirect('/admin/');
        }
        catch (UserException $e)