Commit graph

397 commits

Author SHA1 Message Date
Jo-Philipp Wich
018cbe69a9 libs/web: fix missing escapes in network_ifacelist widget 2012-12-25 02:43:03 +00:00
Jo-Philipp Wich
564ca0accd libs/web: make JS String.format() and String.serialize() available as prototype options, introduce String.nobr() 2012-12-02 14:20:36 +00:00
Jo-Philipp Wich
7c3c6b013b libs/web: let luci.i18n.setlanguage() return the lang that was actually loaded 2012-12-02 13:30:46 +00:00
Jo-Philipp Wich
f7b4fd2979 libs/web: various changes in template library
- rename sanitize_pcdata() and sanitize_utf8() to pcdata() and utf8()
	- implement striptags()
2012-11-26 14:26:43 +00:00
Manuel Munz
e2f3b8923d libs/web: Allow to disable buttons in cbi models from the controller 2012-11-26 13:11:41 +00:00
Jo-Philipp Wich
848e43a5b4 remove .i18n annotations from controller files 2012-11-26 12:53:43 +00:00
Daniel Golle
d07036b59c "Waiting for router..." is misleading on non-router devices. Use "Waiting for changes to be applied..." instead. 2012-11-26 11:07:11 +00:00
Jo-Philipp Wich
68e9458ae0 libs/web: remove unneeded include 2012-11-25 19:22:38 +00:00
Jo-Philipp Wich
cd0bb63394 libs/web: remove leftover debugging code in template_parser.c 2012-11-25 19:18:15 +00:00
Jo-Philipp Wich
0e50aa690a libs/web: rewrite template engine, merge lmo library
- template parser: merge lmo library
	- template parser: rewrite to operate on memory mapped files
	- template parser: implement proper line number reporting on syntax errors
	- template parser: process translate tags directly and bypass Lua
	- template lmo: introduce load_catalog(), change_catalog() and close_catalog()
	- template lmo: rewrite index processing to operate directly on the memory mapped file
	- template lmo: implement binary search keys, reducing the lookup complexity to O(log n)
	- po2lmo: write sorted indixes when generating *.lmo archives
	- i18n: use the template parser for translations
	- i18n: stub load(), loadc() and clear()
	- i18n: map setlanguage() to load_catalog()
2012-11-25 19:17:55 +00:00
Jo-Philipp Wich
2675ad1c63 libs/web: fix luci.http.write_json() to properly encode control chars in strings 2012-11-21 16:04:13 +00:00
Jo-Philipp Wich
c802c941cb libs/web: relax validation for hostnames to allow names like _kerberos._udp.EXAMPLE.COM 2012-10-06 23:10:43 +00:00
Jo-Philipp Wich
b0d3b82400 libs/web: transparently handle userdata in write_json() 2012-09-15 14:25:18 +00:00
Jo-Philipp Wich
c4d0dd19b7 libs/web: merge luci.http.protocol fix from Fonosfera
See http://trac.fonosfera.org/fon-ng/changeset/2102/trunk/luci/libs/http .
2012-08-29 13:06:58 +00:00
Jo-Philipp Wich
b7026b156d libs/web: export translatef() into templates 2012-08-14 15:31:26 +00:00
Jo-Philipp Wich
c78e445583 libs/web: rework unspecified/create logic for checkboxes in network_netlist widget 2012-08-09 23:42:53 +00:00
Jo-Philipp Wich
b35ab62ada libs/web: support placeholder attribute for comboboxes, fix validation quirks with input->select transition in comboboxes 2012-08-09 11:25:25 +00:00
Jo-Philipp Wich
4d2332c01c libs/web: add missing css class to cbi simpleform template 2012-08-08 11:29:46 +00:00
Jo-Philipp Wich
7bca24db1b libs/web: adapt dispatcher to sauth api changes 2012-08-08 09:48:50 +00:00
Jo-Philipp Wich
abef50b852 libs/web: rework luci.sauth
- perform decoding/encoding transparently in read() and write()
	- remove decode() and encode() helpers
	- introduce reap() to kill expired sessions
2012-08-08 09:48:47 +00:00
Jo-Philipp Wich
a58370ab74 Rework authentication system
The validity of authentication tokens was determined by the
mtime of respective authentication tokens on filesystem
stored in $sessionpath.
Talking about hardware without RTC or without a prior
connection to a time server, date/time usually around 1970 -
so is the mtime of the authentication token file in
$sessionpath.

When now configuring an internet connection via LuCI, the
system might fetch the current date/time (e.g. via ntp)
which invalidates the token, returns "403 Forbidden" and
kicks the user out of the interface.

This patch changes the authentication system to use time values
based on the uptime of the machine - rather than values based upon
gettimeofday() and {a|m}time values - and save them inside the token.
That way can always determine the difference between login
(last interaction respectively) and the current time, in-
dependant of the system clock jumping backwards/forwards.

Warning: This patch removes the clean() function and respective calls.
This means, invalid tokens will NOT be determined and removed from
filesystem automatically anymore.
Before, every HTTP-call caused a scan for invalid tokens,
which is quite expensive. Instead consider using a cron job
deleting all stalled files periodically.

Contributed by T-Labs, Deutsche Telekom Innovation Laboratories

Signed-off-by: Mirko Vogt <mirko@openwrt.org>
2012-08-07 19:11:56 +00:00
Jo-Philipp Wich
a798da5d8b libs/web: support creating networks in checkbox network widget (#457) 2012-07-24 11:48:03 +00:00
Jo-Philipp Wich
fe7424b68e libs/web: extend network_ifacelist widget to display all networks an iface is member of 2012-06-26 21:49:15 +00:00
Jo-Philipp Wich
6780f757d6 libs/web: implement minlength(), maxlength() and rangelength() datatypes 2012-06-25 09:51:59 +00:00
Jo-Philipp Wich
b6c98f9c57 Fix JSON NaN
Hi,

The attached patch fixes the JSON generation when dealing with NaN (not
a number), this makes the JSON parsing in the web browser succeed
(before it would get a "nan" which is not a valid JS value)

Chris
2012-04-16 16:48:59 +00:00
Jo-Philipp Wich
fd28386e35 libs/web: fix html output for complex datatypes containing apostrophes 2012-04-15 14:31:04 +00:00
Manuel Munz
7fdb055265 libs/datatypes: Fix typo 2012-04-13 18:12:34 +00:00
Jo-Philipp Wich
fd0f8e80c5 libs/web: fix wrong default focus in dynlist widgets (#388) 2012-03-04 14:15:09 +00:00
Jo-Philipp Wich
1c10042f8c libs/web: fix delete action in tblsections, fix extedit buttons 2012-02-15 22:08:51 +00:00
Jo-Philipp Wich
5d45927643 libs/web: remove inline styles from firewall_zoneforwards and firewall_zonelist widgets 2012-02-15 17:50:25 +00:00
Jo-Philipp Wich
7c9dd3ab81 libs/web: remove inline styles from network_netinfo widget 2012-02-15 16:43:39 +00:00
Jo-Philipp Wich
481ddd0909 libs/web: remove inline styles for interface badges 2012-02-15 16:00:23 +00:00
Jo-Philipp Wich
857dcdf727 libs/web: remove more inline styles from tblsection template, fixes action buttons in bootstrap theme 2012-02-15 15:27:03 +00:00
Jo-Philipp Wich
13beaf8b3d libs/web: use new button classes for tblsection template 2012-02-15 15:13:27 +00:00
Jo-Philipp Wich
47b51b54e8 libs/web: fix firewall_zoneforwards template for bootstrap theme 2012-02-15 15:12:53 +00:00
Jo-Philipp Wich
63a75c6ea9 libs/web: implement new phone digit datatype, useful for VoIP related config screens 2012-02-14 15:16:53 +00:00
Jo-Philipp Wich
8412034c3d libs/web: use CSS class for sort buttons, drop inline style 2012-02-14 15:08:12 +00:00
Jo-Philipp Wich
75f849ca58 libs/web: fix invalid html after r8224 - the whitespace trimming removed the space between the attributes 2012-02-14 14:11:57 +00:00
Patrick Grimm
a3b0db7d86 libs/web: fix line wrapping error 2012-02-13 00:44:56 +00:00
Patrick Grimm
9305afaf0d libs/web: replace <a href> by <input type=button> for better css style in tables 2012-02-12 22:50:48 +00:00
Jo-Philipp Wich
a4996261ea libs/web: remove debugging code 2012-01-08 23:39:29 +00:00
Jo-Philipp Wich
875baa244a libs/web: allow zero-length string literals when parsing datatypes 2012-01-08 23:36:35 +00:00
Jo-Philipp Wich
9fcdf0fe81 libs/web: introduce recursive expression support for datatypes, introduce "or" and "and" datatypes
The commit adds a recursive parser for datatype expressions which allows nesting of validators,
this allows for complex expressions like  "list(or(range(0,65535),'infinite'))" to allow a list of
values which are either integers between 0 and 65535 or the literal string "inifinite".
That change also deprecates combined datatypes like "ipaddr" ["or(ip4addr,ip6addr)"] or
"host" ["or(hostname,ip4addr,ip6addr)"]
2012-01-08 23:33:47 +00:00
Jo-Philipp Wich
3812f29087 libs/web: remove neg_ipaddr, neg_ip4addr and neg_network_ip4addr datatypes, can be represented with neg(type) 2012-01-07 22:06:02 +00:00
Jo-Philipp Wich
3553d308f6 [PATCH] Naive fix for bug #208
For SimpleSection, use the section name (always "1") instead of the
section type in the CBI-like string used to identify the upload.  This
allows upload fields to be placed in SimpleSections.  The fix changes a
minimal number of lines, but does introduce some unnecessary confusion,
it may or may not be better than a more thorough/invasive fix.

Set the enctype for the form element in the simpleform view to be
multipart/form-data because the default
application/x-www-form-urlencoded does not support input files.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2011-12-20 17:52:10 +00:00
Jo-Philipp Wich
8358175f25 libs/web: show input/forward hints in zonelist widget only if bnoth allowany and allowlocal are enabled 2011-12-20 17:51:44 +00:00
Jo-Philipp Wich
b89300eb67 libs/web: prevent break between action buttons in tblsection template 2011-12-20 03:57:40 +00:00
Jo-Philipp Wich
48838ea0f7 libs/web: fix placeholder attribute for DynList 2011-12-20 03:00:17 +00:00
Jo-Philipp Wich
161218a576 libs/web: fix undesired autofocus of DynamicList widget 2011-12-20 02:56:03 +00:00
Jo-Philipp Wich
6ae669da06 libs/web: improve ip6addr datype validation, accept both CIDR and IP/Mask notation 2011-12-20 02:44:32 +00:00