Permalink
Browse files

Removed the atoms in parse_post and parse query, backwards incompatib…

…le change updateed wiki and mail for this, added a backwards_compat_flag to gconf put gconf and sconf in the dictionary as opposed to passing them around as args reworked url_type so there are no more flat lists, removed the list_to_atom call for the spec cache.

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@632 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 0139096 commit ef3a52a2a59c585fd62fbcb0ea6fcce430d1fc9b @klacke committed Mar 16, 2004
@@ -3,8 +3,7 @@
out(A) ->
case mail:check_session(A) of
{ok, Session} ->
- L = yaws_api:parse_query(A),
- {value, {_,Nr}} = lists:keysearch(nr,1,L),
+ {ok, Nr} = queryvar(A, "nr"),
mail:showheaders(Session, list_to_integer(Nr));
Error ->
Error
@@ -4,7 +4,7 @@ out(A) ->
case mail:check_session(A) of
{ok, Session} ->
L = yaws_api:parse_post(A),
- Op = mail:get_val(cmd, L, ""),
+ Op = mail:get_val("cmd", L, ""),
ToDelete = [M || {M,Op} <- L, Op=="yes"],
mail:delete(Session, ToDelete);
Error ->
@@ -7,8 +7,8 @@ out(A) ->
'POST' ->
yaws_api:parse_post(A)
end,
- case {lists:keysearch(user, 1, L),
- lists:keysearch(password, 1, L)} of
+ case {lists:keysearch("user", 1, L),
+ lists:keysearch("password", 1, L)} of
{{value, {_, User}}, {value, {_,Passwd}}} ->
case mail:login(User, Passwd) of
{ok, Cookie} ->
@@ -10,7 +10,7 @@ out(A) ->
_ -> false
end,
Sort =
- case lists:keysearch(sort,1,L) of
+ case lists:keysearch("sort",1,L) of
{value, {_,SortStr}} -> list_to_atom(SortStr);
_ -> undefined
end,
@@ -4,22 +4,22 @@ out(A) ->
case mail:check_session(A) of
{ok, Session} ->
L = yaws_api:parse_post(A),
- Cmd = mail:get_val(cmd, L, reply),
+ Cmd = mail:get_val("cmd", L, reply),
case Cmd of
"reply" ->
- From = yaws_api:url_decode(mail:get_val(from, L, "")),
- Subject = yaws_api:url_decode(mail:get_val(subject, L, "")),
- To = yaws_api:url_decode(mail:get_val(to, L, "")),
- Cc = yaws_api:url_decode(mail:get_val(cc, L, "")),
- Bcc = yaws_api:url_decode(mail:get_val(bcc, L, "")),
+ From = yaws_api:url_decode(mail:get_val("from", L, "")),
+ Subject = yaws_api:url_decode(mail:get_val("subject", L, "")),
+ To = yaws_api:url_decode(mail:get_val("to", L, "")),
+ Cc = yaws_api:url_decode(mail:get_val("cc", L, "")),
+ Bcc = yaws_api:url_decode(mail:get_val("bcc", L, "")),
NewCc =
if To == [] -> Cc;
Cc == [] -> To;
true -> To ++ ", " ++ Cc
end,
mail:compose(Session,"",From,NewCc,Bcc,"RE: "++Subject,"");
"delete" ->
- Nr = mail:get_val(nr, L, ""),
+ Nr = mail:get_val("nr", L, ""),
mail:delete(Session, [list_to_atom(Nr)])
end;
Error ->
@@ -4,7 +4,7 @@ out(A) ->
case mail:check_session(A) of
{ok, Session} ->
L = yaws_api:parse_query(A),
- {value, {_,Nr}} = lists:keysearch(nr,1,L),
+ {value, {_,Nr}} = lists:keysearch("nr",1,L),
mail:showmail(Session, list_to_integer(Nr));
Error ->
Error
@@ -11,7 +11,7 @@
out(A) ->
case mail:check_session(A) of
{ok, Session} ->
- case yaws_api:queryvar(A, nr) of
+ case yaws_api:queryvar(A, "nr") of
{ok, Nr} ->
mail:send_attachment(Session, yaws:to_integer(Nr));
_ ->
Oops, something went wrong. Retry.

0 comments on commit ef3a52a

Please sign in to comment.