Ejemplo n.º 1
0
    // nur Webmaster duerfen User neue Zugangsdaten zuschicken
    // nur ausfuehren, wenn E-Mails vom Server unterstuetzt werden
    // nur an Mitglieder der eigenen Organisation schicken
    if (!$gCurrentUser->isWebmaster() || $gPreferences['enable_system_mails'] != 1 || $this_orga == false) {
        $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
    }
    if ($gPreferences['enable_system_mails'] == 1) {
        try {
            // neues Passwort generieren und abspeichern
            $password = PasswordHashing::genRandomPassword(8);
            $user->setPassword($password);
            $user->save();
            // Mail an den User mit den Loginaten schicken
            $sysmail = new SystemMail($gDb);
            $sysmail->addRecipient($user->getValue('EMAIL'), $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME'));
            $sysmail->setVariable(1, $password);
            $sysmail->sendSystemMail('SYSMAIL_NEW_PASSWORD', $user);
            $gMessage->setForwardUrl($gNavigation->getUrl());
            $gMessage->show($gL10n->get('SYS_EMAIL_SEND'));
        } catch (AdmException $e) {
            $e->showText();
        }
    }
} elseif ($getMode === 5) {
    // Fragen, ob Zugangsdaten verschickt werden sollen
    $gMessage->setForwardYesNo($g_root_path . '/adm_program/modules/members/members_function.php?usr_id=' . $getUserId . '&mode=4');
    $gMessage->show($gL10n->get('MEM_SEND_NEW_LOGIN', $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME')));
} elseif ($getMode === 6) {
    if ($this_orga == true && $other_orga == 0 && $gCurrentUser->isWebmaster()) {
        // nur Webmaster duerfen dies
        // User ist NUR Mitglied der aktuellen Orga -> dann fragen, ob Ehemaliger oder ganz loeschen
Ejemplo n.º 2
0
        // show error if no user found or more than one user found
        if ($count === 0) {
            $gMessage->show($gL10n->get('SYS_LOSTPW_EMAIL_ERROR', $_POST['recipient_email']));
        } elseif ($count > 1) {
            $gMessage->show($gL10n->get('SYS_LOSTPW_SEVERAL_EMAIL', $_POST['recipient_email']));
        }
        $row = $pdoStatement->fetch();
        $user = new User($gDb, $gProfileFields, $row['usr_id']);
        // create and save new password and activation id
        $newPassword = PasswordHashing::genRandomPassword(8);
        $activationId = PasswordHashing::genRandomPassword(10);
        $user->setPassword($newPassword, true);
        $user->setValue('usr_activation_code', $activationId);
        $sysmail = new SystemMail($gDb);
        $sysmail->addRecipient($user->getValue('EMAIL'), $user->getValue('FIRST_NAME', 'database') . ' ' . $user->getValue('LAST_NAME', 'database'));
        $sysmail->setVariable(1, $newPassword);
        $sysmail->setVariable(2, $g_root_path . '/adm_program/system/password_activation.php?usr_id=' . $user->getValue('usr_id') . '&aid=' . $activationId);
        $sysmail->sendSystemMail('SYSMAIL_ACTIVATION_LINK', $user);
        $user->saveChangesWithoutRights();
        $user->save();
        $gMessage->setForwardUrl($g_root_path . '/adm_program/system/login.php');
        $gMessage->show($gL10n->get('SYS_LOSTPW_SEND', $_POST['recipient_email']));
    } catch (AdmException $e) {
        $e->showHtml();
    }
} else {
    /*********************HTML_PART*******************************/
    // create html page object
    $page = new HtmlPage($headline);
    // add back link to module menu
    $lostPasswordMenu = $page->getMenu();