function action_change_password($eventData) { global $gPageStatus, $gLocale; if ($eventData['newpassworda'] == $eventData['newpasswordb']) { $result = \Innomatic\Core\InnomaticContainer::setRootPassword($eventData['oldpassword'], $eventData['newpassworda']); switch ($result) { case 1: $gPageStatus = $gLocale->getStr('passwordchanged_status'); break; case \Innomatic\Core\InnomaticContainer::SETROOTPASSWORD_NEW_PASSWORD_IS_EMPTY: $gPageStatus = $gLocale->getStr('newpasswordisempty_status'); break; case \Innomatic\Core\InnomaticContainer::SETROOTPASSWORD_UNABLE_TO_WRITE_NEW_PASSWORD: $gPageStatus = $gLocale->getStr('unabletowritenewpassword_status'); break; case \Innomatic\Core\InnomaticContainer::SETROOTPASSWORD_OLD_PASSWORD_IS_WRONG: $gPageStatus = $gLocale->getStr('wrongoldpassword_status'); break; } } else { $gPageStatus = $gLocale->getStr('newpasswordnomatch_status'); } }