util.pposix: Compatibility with Solaris systems (thanks Filip)
[prosody.git] / util / dataforms.lua
index 58b45fd354dff0d54971ace5f609bde83bb5d35d..ed62f9b185dfdc60a23ca287987344d9c9e14617 100644 (file)
@@ -1,3 +1,11 @@
+-- Prosody IM
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
+-- 
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
 local setmetatable = setmetatable;
 local pairs, ipairs = pairs, ipairs;
 local tostring, type = tostring, type;
@@ -29,7 +37,7 @@ function form_t.form(layout, data)
                -- Add field tag
                form:tag("field", { type = field_type, var = field.name, label = field.label });
 
-               local value = data[field.name];
+               local value = data[field.name] or field.value;
                
                -- Add value, depending on type
                if field_type == "hidden" then