diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-09-23 18:13:03 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-09-23 18:13:03 +0000 |
commit | fb00ff8f05dae3c110beceb929ea036e4cd14ae1 (patch) | |
tree | 51d124ce1c65e3a600a7da7b9dd57ffafd83f910 /provisioning-scripts.lua | |
parent | 60ef6e20019e046aa801325d29893ada12b5d5af (diff) | |
download | acf-provisioning-fb00ff8f05dae3c110beceb929ea036e4cd14ae1.tar.bz2 acf-provisioning-fb00ff8f05dae3c110beceb929ea036e4cd14ae1.tar.xz |
Change function prototypes to pass self and use self.model instead of functions table
Changed the order of the first two parameters passed to validate function in provisioning_params
Replaced all APP references with self, now that self is available
Still need to implement swapvalidateparams script
Diffstat (limited to 'provisioning-scripts.lua')
-rw-r--r-- | provisioning-scripts.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/provisioning-scripts.lua b/provisioning-scripts.lua index 713c8c9..4741062 100644 --- a/provisioning-scripts.lua +++ b/provisioning-scripts.lua @@ -684,7 +684,7 @@ param_groups_to_params = { provisioning_params = { "CREATE TABLE provisioning_params (param_id SERIAL PRIMARY KEY, name VARCHAR(255) UNIQUE, type VARCHAR(255), label VARCHAR(255), descr VARCHAR(255), value VARCHAR(255), seq INTEGER, regexp VARCHAR(255), validate text)", "CREATE INDEX params_name_idx ON provisioning_params (name)", - "INSERT INTO provisioning_params VALUES(default, 'mac', 'text', 'MAC Address', 'Capitalized hex digits with no puncuation', '', '1', '^%x%x%x%x%x%x%x%x%x%x%x%x$', E'local value, functions, params = ...\nvalue = string.upper(value)\nlocal others = functions.getselectresponse(\"SELECT count(*) FROM provisioning_values WHERE param_id=\\'\"..params.value.device.value.mac.param_id..\"\\' AND device_id!=\\'\"..params.value.device_id.value..\"\\' AND value=\\'\"..value..\"\\'\")\nif tonumber(others[1].count) > 0 then\n\treturn value, \"MAC Address must be unique\"\nend\nreturn value')", + "INSERT INTO provisioning_params VALUES(default, 'mac', 'text', 'MAC Address', 'Capitalized hex digits with no puncuation', '', '1', '^%x%x%x%x%x%x%x%x%x%x%x%x$', E'local self, value, params = ...\nvalue = string.upper(value)\nlocal others = self.getselectresponse(\"SELECT count(*) FROM provisioning_values WHERE param_id=\\'\"..params.value.device.value.mac.param_id..\"\\' AND device_id!=\\'\"..params.value.device_id.value..\"\\' AND value=\\'\"..value..\"\\'\")\nif tonumber(others[1].count) > 0 then\n\treturn value, \"MAC Address must be unique\"\nend\nreturn value')", "INSERT INTO provisioning_params VALUES(default, 'template', 'select', 'Template', '', '', '2', '', null)", "INSERT INTO provisioning_params VALUES(default, 'registrar', 'text', 'SIP Registrar', '', '', '3', '', null)", "INSERT INTO provisioning_params VALUES(default, 'digitmap', 'text', 'Digit Map', 'Phone dial pattern based on section 2.1.5 of RFC 3435, plus a comma to turn dialtone back on', '', '4', '^[*#0-9xT|,.%[%]-]*$', null)", @@ -715,7 +715,7 @@ provisioning_params = { "INSERT INTO provisioning_params VALUES(default, 'speeddialenable', 'boolean', 'Speed Dial Enable', '', 'true', '206', '', null)", "INSERT INTO provisioning_params VALUES(default, 'mailbox', 'text', 'Voice Mailbox', 'Mailbox extension or URL', '', '207', '', null)", "INSERT INTO provisioning_params VALUES(default, 'mailcallback', 'text', 'Voice Mailbox Callback', 'Extension or URL for mailbox message retrieval', '', '208', '', null)", - "INSERT INTO provisioning_params VALUES(default, 'databaseversion', 'text', 'Provisioning Database Version', 'Do not edit or delete!', '1', '999', '', null)" + "INSERT INTO provisioning_params VALUES(default, 'databaseversion', 'text', 'Provisioning Database Version', 'Do not edit or delete!', '2', '999', '', null)" } -- All of the (non-default) parameter values for all devices are stored here |