parsav  Diff

Differences From Artifact [7f83a40056]:

To Artifact [f6e2d18341]:


     9      9   	lib.osclock.ctime_r(&time, &tstr[0])
    10     10   	var body = data.view.conf_sec {
    11     11   		lastreset = pstr {
    12     12   			ptr = &tstr[0], ct = lib.str.sz(&tstr[0])
    13     13   		}
    14     14   	}
    15     15   	
           16  +	var a: lib.str.acc a:init(768) defer a:free()
           17  +
    16     18   	if co.srv.cfg.credmgd then
    17     19   		var new = co:pgetv('new')
    18         -		var a: lib.str.acc a:init(768)
    19     20   		if not new then
    20     21   			body:append(&a)
    21     22   			var credmgr = data.view.conf_sec_credmg {
    22     23   				credlist = pstr{'',0};
    23     24   			}
    24     25   			var creds = co.srv:auth_enum_uid(uid)
    25     26   			if creds.ct > 0 then defer creds:free()
................................................................................
    33     34   						cl:lpush('</option>')
    34     35   					end
    35     36   				end
    36     37   				credmgr.credlist = cl:finalize()
    37     38   			end
    38     39   			credmgr:append(&a)
    39     40   			if credmgr.credlist.ct > 0 then credmgr.credlist:free() end
    40         -		elseif new:cmp(lib.str.plit'pw') then
    41         -			var d: data.view.conf_sec_pwnew
    42         -			var time = lib.osclock.time(nil)
    43         -			var timestr: int8[26] lib.osclock.ctime_r(&time, &timestr[0])
    44         -			var cmt: lib.str.acc
    45         -			cmt:init(48):lpush('enrolled over http on '):push(&timestr[0],0)
    46         -			d.comment = cmt:finalize()
           41  +		else
           42  +			if new:cmp(lib.str.plit'pw') then
           43  +				var d: data.view.conf_sec_pwnew
           44  +				var time = lib.osclock.time(nil)
           45  +				var timestr: int8[26] lib.osclock.ctime_r(&time, &timestr[0])
           46  +				var cmt: lib.str.acc
           47  +				cmt:init(48):lpush('enrolled over http on '):push(&timestr[0],0)
           48  +				d.comment = cmt:finalize()
           49  +
           50  +				var st = d:tostr()
           51  +				d.comment:free()
           52  +				return st
           53  +			elseif new:cmp(lib.str.plit'challenge') then
           54  +			-- we're going to break the rules a bit and do database munging from
           55  +			-- the rendering code, because doing otherwise in this case would be
           56  +			-- genuinely nightmarish
           57  +			elseif new:cmp(lib.str.plit'otp') then
           58  +			elseif new:cmp(lib.str.plit'api') then
           59  +			else return pstr.null() end
           60  +		end
           61  +	else body:append(&a) end
    47     62   
    48         -			var st = d:tostr()
    49         -			d.comment:free()
    50         -			return st
    51         -		elseif new:cmp(lib.str.plit'challenge') then
    52         -		-- we're going to break the rules a bit and do database munging from
    53         -		-- the rendering code, because doing otherwise in this case would be
    54         -		-- genuinely nightmarish
    55         -		elseif new:cmp(lib.str.plit'otp') then
    56         -		elseif new:cmp(lib.str.plit'api') then
    57         -		else return pstr.null() end
    58         -		return a:finalize()
    59         -	else return body:tostr() end
           63  +	return a:finalize()
    60     64   end
    61     65   
    62     66   terra lib.render.conf.sec_overlay
    63     67   (co: &lib.srv.convo, path: lib.mem.ptr(pref)): pstr
    64     68    -- render the credential panel for the current user, allowing
    65     69    -- it to be reused in the administration UI
    66     70   	return render_conf_sec(co,co.who.id)
    67     71   end
    68     72   
    69     73   return render_conf_sec