This was such a crappy post (and author) my head explodes.
mannu
@mannu
Best posts made by mannu
Latest posts made by mannu
-
RE: Why users only make things worse
-
RE: Exception handling!<FONT size=2>posted in Side Bar WTF
Yes, it sucks badly. :( Here's one more funny thing among lots of others.</FONT>
<FONT color=#008000 size=2>//TODO: Fixa denna på något sätt (means: Fix this somehow)
</FONT><FONT color=#0000ff size=2>protected</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>PageDataCollection</FONT><FONT size=2> CurrentNewsList
{
</FONT><FONT color=#0000ff size=2>get</FONT><FONT size=2>{</FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>PageDataCollection</FONT><FONT size=2>();}
}</FONT>It's not even built!
<FONT size=2>Not to mention anything that accepts user input is vulnerable to SQL injection. Locks everywhere without any reason since it's single-threaded. Caches user information when logged in without any reason. Functions and properties stuffed into any source file without any architectural thought at all. Username when logged stored as cookie, etc...</FONT>
<FONT size=2></FONT><FONT size=2>YAAAAAAR!! :(
</FONT> -
RE: Exception handling!
It compiles. Not even a warning. :/
No idea how it got to the customer... I am going on-site tomorrow to clean up the mess. I hope things will work or I'll be quite ashamed myself.
-
Exception handling!
Just got back from vacation and lots of people are gone. Have to fix a "finished" project which of course doesn't work on-site. Customer got very angry that many things just doesn't work.
Here is one of all the nice things I found!
<FONT size=2></FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>static</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>IntranetUserCollection</FONT><FONT size=2> GetUsersFromLDAPSearch(Ldap.</FONT><FONT color=#2b91af size=2>LdapSearch</FONT><FONT size=2> searcher)
{
</FONT><FONT color=#2b91af size=2>IntranetUserCollection</FONT><FONT size=2> coll = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>IntranetUserCollection</FONT><FONT size=2>();
</FONT><FONT color=#0000ff size=2>while</FONT><FONT size=2>(searcher.Read())
{
</FONT><FONT color=#2b91af size=2>IntranetUser</FONT><FONT size=2> retUser = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>IntranetUser</FONT><FONT size=2>();
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.DomainUserName = EPiServer.</FONT><FONT color=#2b91af size=2>Global</FONT><FONT size=2>.EPConfig[</FONT><FONT color=#a31515 size=2>"EPsLdapDomain"</FONT><FONT size=2>] + </FONT><FONT color=#a31515 size=2>"\\"</FONT><FONT size=2> + searcher[</FONT><FONT color=#a31515 size=2>"sAMAccountName"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch
</FONT><FONT size=2>{
</FONT><FONT color=#0000ff size=2>continue</FONT><FONT size=2>;
}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.FirstName = searcher[</FONT><FONT color=#a31515 size=2>"givenName"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.LastName = searcher[</FONT><FONT color=#a31515 size=2>"sn"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.Email = searcher[</FONT><FONT color=#a31515 size=2>"mail"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.Telephone1 = searcher[</FONT><FONT color=#a31515 size=2>"telephoneNumber"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.Telephone2 = searcher[</FONT><FONT color=#a31515 size=2>"mobile"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.Title = searcher[</FONT><FONT color=#a31515 size=2>"title"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> areaID = </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>.MinValue;
</FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> rssUrl = </FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2>.Empty;
</FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> areaName = searcher[</FONT><FONT color=#a31515 size=2>"company"</FONT><FONT size=2>].Length > 0 ? searcher[</FONT><FONT color=#a31515 size=2>"company"</FONT><FONT size=2>][0]:</FONT><FONT color=#a31515 size=2>""</FONT><FONT size=2>;
GetBusinessAreaID(areaName, </FONT><FONT color=#0000ff size=2>out</FONT><FONT size=2> areaID, </FONT><FONT color=#0000ff size=2>out</FONT><FONT size=2> rssUrl);
retUser.DefaultBusinessAreaCategoryID = areaID;
</FONT><FONT color=#2b91af size=2>Util</FONT><FONT size=2>.RssFeedURL = rssUrl;
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.Office = searcher[</FONT><FONT color=#a31515 size=2>"physicalDeliveryOfficeName"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
</FONT><FONT color=#0000ff size=2>try
</FONT><FONT size=2>{
retUser.Department = searcher[</FONT><FONT color=#a31515 size=2>"department"</FONT><FONT size=2>][0];
}
</FONT><FONT color=#0000ff size=2>catch</FONT><FONT size=2>{}
coll.Add(retUser);
}
</FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> coll;
}
</FONT> -
Web 3.0
I got this in a mail from a quite incompetent client I am currently building a site in an advanced yet easy-to-use CMS for.
<FONT face="Courier New" size=2>Would it be possible for XXX to make pdf files about the whole site?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT>
<FONT face="Courier New" size=2>Then it would be easy to make the changes (like we do changes for artworks).<o:p></o:p></FONT>
<FONT face="Courier New" size=2>I do not know how to make changes to internet site directly. <o:p></o:p></FONT>
-
Authorization WTF
You may think this is fake, but it is not.
string user;
try
{
user = CurrentPerson.UserName;
}
catch (Exception)
{
user = "Admin";
}Found in production code...