diff options
author | Malf Furious <m@lfurio.us> | 2016-03-12 15:05:12 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-03-27 20:16:32 -0400 |
commit | cc755e3756e43109d0db0de963b3a132039456b1 (patch) | |
tree | ac36ae05d78f1ba8319691482bdfe30e218cca1b | |
parent | a5eb5c0ee075b8d307e63ce936f2bc4b4592ed21 (diff) | |
download | scrott-cc755e3756e43109d0db0de963b3a132039456b1.tar.gz scrott-cc755e3756e43109d0db0de963b3a132039456b1.zip |
Alter representation of form boolean values
Changed how Form() objects model true and false for boolean fields. Was "true" and "false", is now "1" and "0", respectivly.
This is to address how Mysql handles these values as they are pushed to the db.
-rw-r--r-- | app/class/form.class.php | 2 | ||||
-rw-r--r-- | app/model/common.mod.php | 2 | ||||
-rw-r--r-- | app/view/common/setting.modal.view.php | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php index 808de27..9f103ba 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -82,7 +82,7 @@ class Form */ function field_bool($name) { - $this->field_enum($name, array("true", "false"), "false"); + $this->field_enum($name, array("1", "0"), "0"); } /* diff --git a/app/model/common.mod.php b/app/model/common.mod.php index a0bf6ae..33acb1b 100644 --- a/app/model/common.mod.php +++ b/app/model/common.mod.php @@ -79,7 +79,7 @@ class CommonModel extends MasterModel return; } - if ($form->setPasswd == "true") + if ($form->setPasswd) { if ($user->validatePassword($form->curPasswd)) { diff --git a/app/view/common/setting.modal.view.php b/app/view/common/setting.modal.view.php index 909eead..d9a834b 100644 --- a/app/view/common/setting.modal.view.php +++ b/app/view/common/setting.modal.view.php @@ -40,7 +40,7 @@ <div class="checkbox"> <label data-toggle="collapse" data-target="#inputUserPasswdCollapse"> - <input type="checkbox" name="input[setPasswd]" value="true" /> Change Password + <input type="checkbox" name="input[setPasswd]" value="1" /> Change Password </label> </div> @@ -118,7 +118,7 @@ <label>Access</label> <div class="checkbox"> <label> - <input type="checkbox" name="input[allowPublicSignup]" value="true" <?=$mod->common_settingAdminAllowPublicSignupChecked?> /> Allow anyone to create an account + <input type="checkbox" name="input[allowPublicSignup]" value="1" <?=$mod->common_settingAdminAllowPublicSignupChecked?> /> Allow anyone to create an account </label> </div> |