parsav  Diff

Differences From Artifact [7f83a40056]:

To Artifact [f6e2d18341]:


9
10
11
12
13
14
15


16
17
18
19
20
21
22
23
24
25
..
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57



58
59
60
61
62
63
64
65
66
67
68
69
	lib.osclock.ctime_r(&time, &tstr[0])
	var body = data.view.conf_sec {
		lastreset = pstr {
			ptr = &tstr[0], ct = lib.str.sz(&tstr[0])
		}
	}
	


	if co.srv.cfg.credmgd then
		var new = co:pgetv('new')
		var a: lib.str.acc a:init(768)
		if not new then
			body:append(&a)
			var credmgr = data.view.conf_sec_credmg {
				credlist = pstr{'',0};
			}
			var creds = co.srv:auth_enum_uid(uid)
			if creds.ct > 0 then defer creds:free()
................................................................................
						cl:lpush('</option>')
					end
				end
				credmgr.credlist = cl:finalize()
			end
			credmgr:append(&a)
			if credmgr.credlist.ct > 0 then credmgr.credlist:free() end

		elseif new:cmp(lib.str.plit'pw') then
			var d: data.view.conf_sec_pwnew
			var time = lib.osclock.time(nil)
			var timestr: int8[26] lib.osclock.ctime_r(&time, &timestr[0])
			var cmt: lib.str.acc
			cmt:init(48):lpush('enrolled over http on '):push(&timestr[0],0)
			d.comment = cmt:finalize()

			var st = d:tostr()
			d.comment:free()
			return st
		elseif new:cmp(lib.str.plit'challenge') then
		-- we're going to break the rules a bit and do database munging from
		-- the rendering code, because doing otherwise in this case would be
		-- genuinely nightmarish
		elseif new:cmp(lib.str.plit'otp') then
		elseif new:cmp(lib.str.plit'api') then
		else return pstr.null() end



		return a:finalize()
	else return body:tostr() end
end

terra lib.render.conf.sec_overlay
(co: &lib.srv.convo, path: lib.mem.ptr(pref)): pstr
 -- render the credential panel for the current user, allowing
 -- it to be reused in the administration UI
	return render_conf_sec(co,co.who.id)
end

return render_conf_sec







>
>


<







 







>
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
>
>
>
|
<










9
10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
71
72
73
	lib.osclock.ctime_r(&time, &tstr[0])
	var body = data.view.conf_sec {
		lastreset = pstr {
			ptr = &tstr[0], ct = lib.str.sz(&tstr[0])
		}
	}
	
	var a: lib.str.acc a:init(768) defer a:free()

	if co.srv.cfg.credmgd then
		var new = co:pgetv('new')

		if not new then
			body:append(&a)
			var credmgr = data.view.conf_sec_credmg {
				credlist = pstr{'',0};
			}
			var creds = co.srv:auth_enum_uid(uid)
			if creds.ct > 0 then defer creds:free()
................................................................................
						cl:lpush('</option>')
					end
				end
				credmgr.credlist = cl:finalize()
			end
			credmgr:append(&a)
			if credmgr.credlist.ct > 0 then credmgr.credlist:free() end
		else
			if new:cmp(lib.str.plit'pw') then
				var d: data.view.conf_sec_pwnew
				var time = lib.osclock.time(nil)
				var timestr: int8[26] lib.osclock.ctime_r(&time, &timestr[0])
				var cmt: lib.str.acc
				cmt:init(48):lpush('enrolled over http on '):push(&timestr[0],0)
				d.comment = cmt:finalize()

				var st = d:tostr()
				d.comment:free()
				return st
			elseif new:cmp(lib.str.plit'challenge') then
			-- we're going to break the rules a bit and do database munging from
			-- the rendering code, because doing otherwise in this case would be
			-- genuinely nightmarish
			elseif new:cmp(lib.str.plit'otp') then
			elseif new:cmp(lib.str.plit'api') then
			else return pstr.null() end
		end
	else body:append(&a) end

	return a:finalize()

end

terra lib.render.conf.sec_overlay
(co: &lib.srv.convo, path: lib.mem.ptr(pref)): pstr
 -- render the credential panel for the current user, allowing
 -- it to be reused in the administration UI
	return render_conf_sec(co,co.who.id)
end

return render_conf_sec