Esempio n. 1
0
function pass_edit($eventData)
{
    global $wuiMainStatus, $innomaticLocale;
    if ($eventData['newpassworda'] == $eventData['newpasswordb']) {
        if (strlen($eventData['newpassworda'])) {
            $tempUser = new User(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->domaindata['id']);
            $tempUser->setUserIdByUsername(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserName());
            $userData = $tempUser->getUserData();
            if (md5($eventData['oldpassword']) == $userData['password']) {
                $tempUser->changePassword($eventData['newpassworda']);
                $wuiMainStatus->mArgs['status'] = $innomaticLocale->getStr('passwordchanged_status');
            } else {
                $wuiMainStatus->mArgs['status'] = $innomaticLocale->getStr('wrongoldpassword_status');
            }
        } else {
            $wuiMainStatus->mArgs['status'] = $innomaticLocale->getStr('newpasswordisempty_status');
        }
    } else {
        $wuiMainStatus->mArgs['status'] = $innomaticLocale->getStr('newpasswordnomatch_status');
    }
}
 public function executeChpasswd($eventData)
 {
     if ($eventData['uid'] != \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId() and !(User::isAdminUser(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserName(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDomainId()) or \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->hasPermission('edit_password_all'))) {
         return;
     }
     $tempUser = new User(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->domaindata['id'], $eventData['uid']);
     $tempUser->changePassword($eventData['password']);
 }