diff --git a/controllers/EditAlbum.php b/controllers/EditAlbum.php index 26e2c6a..5888876 100644 --- a/controllers/EditAlbum.php +++ b/controllers/EditAlbum.php @@ -123,7 +123,7 @@ class EditAlbum extends HTMLController // Anything missing? if (!empty($form->getMissing())) - return $formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'error')); + return $formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'danger')); $data = $form->getData(); @@ -140,7 +140,7 @@ class EditAlbum extends HTMLController $data['kind'] = 'Album'; $newTag = Tag::createNew($data); if ($newTag === false) - return $formview->adopt(new Alert('Cannot create this album', 'Something went wrong while creating the album...', 'error')); + return $formview->adopt(new Alert('Cannot create this album', 'Something went wrong while creating the album...', 'danger')); if (isset($_POST['submit_and_new'])) { diff --git a/controllers/EditTag.php b/controllers/EditTag.php index 24126c3..4b42926 100644 --- a/controllers/EditTag.php +++ b/controllers/EditTag.php @@ -115,7 +115,7 @@ class EditTag extends HTMLController // Anything missing? if (!empty($form->getMissing())) - return $formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'error')); + return $formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'danger')); $data = $form->getData(); @@ -127,7 +127,7 @@ class EditTag extends HTMLController { $return = Tag::createNew($data); if ($return === false) - return $formview->adopt(new Alert('Cannot create this tag', 'Something went wrong while creating the tag...', 'error')); + return $formview->adopt(new Alert('Cannot create this tag', 'Something went wrong while creating the tag...', 'danger')); if (isset($_POST['submit_and_new'])) { diff --git a/controllers/EditUser.php b/controllers/EditUser.php index bbce589..c5f6578 100644 --- a/controllers/EditUser.php +++ b/controllers/EditUser.php @@ -129,7 +129,7 @@ class EditUser extends HTMLController // Anything missing? if (!empty($form->getMissing())) - return $formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'error')); + return $formview->adopt(new Alert('Some data missing', 'Please fill out the following fields: ' . implode(', ', $form->getMissing()), 'danger')); $data = $form->getData(); @@ -150,18 +150,18 @@ class EditUser extends HTMLController // If it looks like an e-mail address... if (!empty($data['emailaddress']) && !preg_match('~^[^ ]+@[^ ]+\.[a-z]+$~', $data['emailaddress'])) - return $formview->adopt(new Alert('Email addresses invalid', 'The email address you entered is not a valid email address.', 'error')); + return $formview->adopt(new Alert('Email addresses invalid', 'The email address you entered is not a valid email address.', 'danger')); // Check whether email address is already linked to an account in the database -- just not to the account we happen to be editing, of course. elseif (!empty($data['emailaddress']) && Member::exists($data['emailaddress']) && !($id_user && $user->getEmailAddress() == $data['emailaddress'])) - return $formview->adopt(new Alert('Email address already in use', 'Another account is already using the e-mail address you entered.', 'error')); + return $formview->adopt(new Alert('Email address already in use', 'Another account is already using the e-mail address you entered.', 'danger')); // Setting passwords? We'll need two! if (!$id_user || !empty($data['password1']) && !empty($data['password2'])) { if (strlen($data['password1']) < 6 || !preg_match('~[^A-z]~', $data['password1'])) - return $formview->adopt(new Alert('Password not acceptable', 'Please fill in a password that is at least six characters long and contains at least one non-alphabetic character (e.g. a number or symbol).', 'error')); + return $formview->adopt(new Alert('Password not acceptable', 'Please fill in a password that is at least six characters long and contains at least one non-alphabetic character (e.g. a number or symbol).', 'danger')); elseif ($data['password1'] !== $data['password2']) - return $formview->adopt(new Alert('Passwords do not match', 'The passwords you entered do not match. Please try again.', 'error')); + return $formview->adopt(new Alert('Passwords do not match', 'The passwords you entered do not match. Please try again.', 'danger')); else $data['password'] = $data['password1']; @@ -173,7 +173,7 @@ class EditUser extends HTMLController { $return = Member::createNew($data); if ($return === false) - return $formview->adopt(new Alert('Cannot create this user', 'Something went wrong while creating the user...', 'error')); + return $formview->adopt(new Alert('Cannot create this user', 'Something went wrong while creating the user...', 'danger')); if (isset($_POST['submit_and_new'])) { diff --git a/controllers/Login.php b/controllers/Login.php index 46e5da6..d91785d 100644 --- a/controllers/Login.php +++ b/controllers/Login.php @@ -44,7 +44,7 @@ class Login extends HTMLController parent::__construct('Log in - ' . SITE_TITLE); $form = new LogInForm('Log in'); if ($login_error) - $form->adopt(new Alert('', 'Invalid email address or password.', 'error')); + $form->adopt(new Alert('', 'Invalid email address or password.', 'danger')); // Tried anything? Be helpful, at least. if (isset($_POST['emailaddress'])) diff --git a/controllers/ResetPassword.php b/controllers/ResetPassword.php index 7153498..24fa7b6 100644 --- a/controllers/ResetPassword.php +++ b/controllers/ResetPassword.php @@ -48,7 +48,7 @@ class ResetPassword extends HTMLController exit; } else - $form->adopt(new Alert('Some fields require your attention', '', 'error')); + $form->adopt(new Alert('Some fields require your attention', '', 'danger')); } } else @@ -63,7 +63,7 @@ class ResetPassword extends HTMLController $id_user = Authentication::getUserid(trim($_POST['emailaddress'])); if ($id_user === false) { - $form->adopt(new Alert('Invalid email address', 'The email address you provided could not be found in our system. Please try again.', 'error')); + $form->adopt(new Alert('Invalid email address', 'The email address you provided could not be found in our system. Please try again.', 'danger')); return; } diff --git a/models/Dispatcher.php b/models/Dispatcher.php index d5688ab..8280797 100644 --- a/models/Dispatcher.php +++ b/models/Dispatcher.php @@ -50,7 +50,7 @@ class Dispatcher public static function kickGuest($title = null, $message = null) { $form = new LogInForm('Log in'); - $form->adopt(new Alert($title ?? '', $message ?? 'You need to be logged in to view this page.', 'error')); + $form->adopt(new Alert($title ?? '', $message ?? 'You need to be logged in to view this page.', 'danger')); $form->setRedirectUrl($_SERVER['REQUEST_URI']); $page = new MainTemplate('Login required');