quickhac / qhac-ios

Native iOS app to allow checking of grades, based on the QuickHAC Chrome extension.
0 stars 0 forks source link

Fix AISD support #5

Closed tristanseifert closed 10 years ago

tristanseifert commented 10 years ago

Currently has an error 2000 when trying to fetch the averages, as for some reason or another, the server decides to return the login form rather than the grades we care about.

I hate programming.

tristanseifert commented 10 years ago

I think we need another shitty hack to appease that abysmal pile of monkey dung that is ASP.NET, according to this base64-encoded error message (what the hell is it with their obsession with that grr):

<?xml version="1.0" encoding="UTF-8" ?>
<ErrorReport>
   <Application>
      <Name>PC</Name>
      <URL>https://gradespeed.austinisd.org/pc/ParentMain.aspx</URL>
      <Server>GRADEBOOK7</Server>
      <BuildDate>04:00:08 PM, Nov 11 2013</BuildDate>
      <ErrorDate>05:07:19 AM, Dec 31 2013</ErrorDate>
   </Application>
   <UserInfo>
      <UserName>REDACTED</UserName>
      <UserRole>Parent</UserRole>
      <SchoolID></SchoolID>
      <DistrictID>REDACTED</DistrictID>
      <DistrictName>Austin ISD</DistrictName>
   </UserInfo>
   <Exception>
      <Source>System.Web</Source>
      <Message>Invalid postback or callback argument.  Event validation is enabled using &lt;pages enableEventValidation=&quot;true&quot;/&gt; in configuration or &lt;%@ Page EnableEventValidation=&quot;true&quot; %&gt; in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.</Message>
      <StackTrace>   at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
   at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
   at System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</StackTrace>
   </Exception>
   <Form>
      <Item>
         <Name>__EVENTARGUMENT</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>__EVENTTARGET</Name>
         <Value>_ctl0$ddlStudents</Value>
      </Item>
      <Item>
         <Name>__EVENTVALIDATION</Name>
         <Value>/wEWBAKttdaCAwLNkKyYDAKRpqmpAQKIo6qFC+u93Hy8RTyJHFaDjvskgNnk7mdU</Value>
      </Item>
      <Item>
         <Name>__LASTFOCUS</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>__RUNEVENTARGUMENT</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>__RUNEVENTARGUMENT2</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>__RUNEVENTTARGET</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>__scrollLeft</Name>
         <Value>0</Value>
      </Item>
      <Item>
         <Name>__scrollTop</Name>
         <Value>0</Value>
      </Item>
      <Item>
         <Name>__VIEWSTATE</Name>
         <Value>/wEPDwULLTE4NjA3NjE1MTcPZBYCZg9kFgQCAQ9kFgICAw8WAh4EVGV4dAVJPGxpbmsgaHJlZj0iU3R5bGVTaGVldHMvUENNYXN0ZXIuY3NzIiB0eXBlPSJ0ZXh0L2NzcyIgcmVsPSJzdHlsZXNoZWV0IiAvPmQCAw9kFgICAQ9kFgYCAQ9kFgJmDxYEHgdjb2xzcGFuBQEyHglpbm5lcmh0bWwFFiZuYnNwO1BhcmVudENvbm5lY3Rpb25kAgMPZBYQAgEPFgIfAAU0PGltZyBzcmM9IkdldEZpbGUuYXNweD9kc3RyPTIyNzkwMSZhbXA7ZGVzYz1Mb2dvIiAvPmQCAw8WAh8ABQpBdXN0aW4gSVNEZAIFDxYCHwAFHDxiciAvPjAxOCAtIExBU0EgSGlnaCBTY2hvb2xkAgkPEGQQFQISUGF0aWwsIE5laWwgU2FuamF5ElBhdGlsLCBZYXNoIFNhbmpheRUCBzIwOTY3MzAHMjEwOTA5MBQrAwJnZ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3Rpb25zIGFib3V0IGFueSBvZiB0aGVzZSBpdGVtcywgZmlyc3QgY2hlY2sgd2l0aCB5b3VyIHN0dWRlbnQsIHRoZW4gY29udGFjdCB0aGUgdGVhY2hlciBpZiBuZWNlc3NhcnkuIFBsZWFzZSByZW1lbWJlciB0aGF0IG1vc3Qgc2Vjb25kYXJ5IHNjaG9vbCB0ZWFjaGVycyB0ZWFjaCAxMDAgb3IgbW9yZSBzdHVkZW50cyBlYWNoIHNlbWVzdGVyLCBzbyBnaXZlIHRoZW0gYSByZWFzb25hYmxlIGFtb3VudCBvZiB0aW1lIHRvIHJlc3BvbmQgdG8geW91ciBlbWFpbCBvciBwaG9uZSBjYWxsLjxQPjxCUj5RdWVzdGlvbnMgYWJvdXQgYXR0ZW5kYW5jZSBzaG91bGQgYmUgZGlyZWN0ZWQgdG8gdGhlIGF0dGVuZGFuY2UgY2xlcmsgYXQgeW91ciBjaGlsZCdzIHNjaG9vbC48UD5kAgcPFgIfAGVkAgkPDxYCHwNoZGRkwqBWds3uMhc3tDQjqVXw6h6ZsXI=</Value>
      </Item>
      <Item>
         <Name>_ctl0:ddlStudents</Name>
         <Value>REDACTED</Value>
      </Item>
   </Form>
   <ServerVariables>
      <Item>
         <Name>ALL_HTTP</Name>
         <Value>HTTP_CONNECTION:keep-alive
HTTP_CONTENT_LENGTH:3532
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded; charset=utf-8
HTTP_ACCEPT:*/*
HTTP_ACCEPT_ENCODING:gzip, deflate
HTTP_ACCEPT_LANGUAGE:de;q=1, en-GB;q=0.9, en;q=0.8, fr;q=0.7, zh-Hans;q=0.6, zh-Hant;q=0.5
HTTP_COOKIE:ASP.NET_SessionId=swk3hhreeldb4s5uur2vrxtm; PCLanguage=Code=en; PcLogin=Type=Parent
HTTP_HOST:gradespeed.austinisd.org
HTTP_USER_AGENT:QuickHAC/3A1 (iPhone; iOS 7.0.2; Scale/2.00)
</Value>
      </Item>
      <Item>
         <Name>ALL_RAW</Name>
         <Value>Connection: keep-alive
Content-Length: 3532
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: de;q=1, en-GB;q=0.9, en;q=0.8, fr;q=0.7, zh-Hans;q=0.6, zh-Hant;q=0.5
Cookie: ASP.NET_SessionId=swk3hhreeldb4s5uur2vrxtm; PCLanguage=Code=en; PcLogin=Type=Parent
Host: gradespeed.austinisd.org
User-Agent: QuickHAC/3A1 (iPhone; iOS 7.0.2; Scale/2.00)
</Value>
      </Item>
      <Item>
         <Name>APPL_MD_PATH</Name>
         <Value>/LM/W3SVC/1/Root/PC</Value>
      </Item>
      <Item>
         <Name>APPL_PHYSICAL_PATH</Name>
         <Value>D:\Program Files\Campusware\ParentConnection\Web\</Value>
      </Item>
      <Item>
         <Name>AUTH_TYPE</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>AUTH_USER</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>AUTH_PASSWORD</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>LOGON_USER</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>REMOTE_USER</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>CERT_COOKIE</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>CERT_FLAGS</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>CERT_ISSUER</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>CERT_KEYSIZE</Name>
         <Value>128</Value>
      </Item>
      <Item>
         <Name>CERT_SECRETKEYSIZE</Name>
         <Value>2048</Value>
      </Item>
      <Item>
         <Name>CERT_SERIALNUMBER</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>CERT_SERVER_ISSUER</Name>
         <Value>C=US, O=&quot;Entrust, Inc.&quot;, OU=www.entrust.net/rpa is incorporated by reference, OU=&quot;(c) 2009 Entrust, Inc.&quot;, CN=Entrust Certification Authority - L1C</Value>
      </Item>
      <Item>
         <Name>CERT_SERVER_SUBJECT</Name>
         <Value>C=US, S=Texas, L=Austin, O=Austin Independent School District, CN=gradespeed.austinisd.org</Value>
      </Item>
      <Item>
         <Name>CERT_SUBJECT</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>CONTENT_LENGTH</Name>
         <Value>3532</Value>
      </Item>
      <Item>
         <Name>CONTENT_TYPE</Name>
         <Value>application/x-www-form-urlencoded; charset=utf-8</Value>
      </Item>
      <Item>
         <Name>GATEWAY_INTERFACE</Name>
         <Value>CGI/1.1</Value>
      </Item>
      <Item>
         <Name>HTTPS</Name>
         <Value>on</Value>
      </Item>
      <Item>
         <Name>HTTPS_KEYSIZE</Name>
         <Value>128</Value>
      </Item>
      <Item>
         <Name>HTTPS_SECRETKEYSIZE</Name>
         <Value>2048</Value>
      </Item>
      <Item>
         <Name>HTTPS_SERVER_ISSUER</Name>
         <Value>C=US, O=&quot;Entrust, Inc.&quot;, OU=www.entrust.net/rpa is incorporated by reference, OU=&quot;(c) 2009 Entrust, Inc.&quot;, CN=Entrust Certification Authority - L1C</Value>
      </Item>
      <Item>
         <Name>HTTPS_SERVER_SUBJECT</Name>
         <Value>C=US, S=Texas, L=Austin, O=Austin Independent School District, CN=gradespeed.austinisd.org</Value>
      </Item>
      <Item>
         <Name>INSTANCE_ID</Name>
         <Value>1</Value>
      </Item>
      <Item>
         <Name>INSTANCE_META_PATH</Name>
         <Value>/LM/W3SVC/1</Value>
      </Item>
      <Item>
         <Name>LOCAL_ADDR</Name>
         <Value>192.168.234.122</Value>
      </Item>
      <Item>
         <Name>PATH_INFO</Name>
         <Value>/pc/ParentMain.aspx</Value>
      </Item>
      <Item>
         <Name>PATH_TRANSLATED</Name>
         <Value>D:\Program Files\Campusware\ParentConnection\Web\ParentMain.aspx</Value>
      </Item>
      <Item>
         <Name>QUERY_STRING</Name>
         <Value></Value>
      </Item>
      <Item>
         <Name>REMOTE_ADDR</Name>
         <Value>66.69.221.93</Value>
      </Item>
      <Item>
         <Name>REMOTE_HOST</Name>
         <Value>66.69.221.93</Value>
      </Item>
      <Item>
         <Name>REMOTE_PORT</Name>
         <Value>59854</Value>
      </Item>
      <Item>
         <Name>REQUEST_METHOD</Name>
         <Value>POST</Value>
      </Item>
      <Item>
         <Name>SCRIPT_NAME</Name>
         <Value>/pc/ParentMain.aspx</Value>
      </Item>
      <Item>
         <Name>SERVER_NAME</Name>
         <Value>gradespeed.austinisd.org</Value>
      </Item>
      <Item>
         <Name>SERVER_PORT</Name>
         <Value>443</Value>
      </Item>
      <Item>
         <Name>SERVER_PORT_SECURE</Name>
         <Value>1</Value>
      </Item>
      <Item>
         <Name>SERVER_PROTOCOL</Name>
         <Value>HTTP/1.1</Value>
      </Item>
      <Item>
         <Name>SERVER_SOFTWARE</Name>
         <Value>Microsoft-IIS/6.0</Value>
      </Item>
      <Item>
         <Name>URL</Name>
         <Value>/pc/ParentMain.aspx</Value>
      </Item>
      <Item>
         <Name>HTTP_CONNECTION</Name>
         <Value>keep-alive</Value>
      </Item>
      <Item>
         <Name>HTTP_CONTENT_LENGTH</Name>
         <Value>3532</Value>
      </Item>
      <Item>
         <Name>HTTP_CONTENT_TYPE</Name>
         <Value>application/x-www-form-urlencoded; charset=utf-8</Value>
      </Item>
      <Item>
         <Name>HTTP_ACCEPT</Name>
         <Value>*/*</Value>
      </Item>
      <Item>
         <Name>HTTP_ACCEPT_ENCODING</Name>
         <Value>gzip, deflate</Value>
      </Item>
      <Item>
         <Name>HTTP_ACCEPT_LANGUAGE</Name>
         <Value>de;q=1, en-GB;q=0.9, en;q=0.8, fr;q=0.7, zh-Hans;q=0.6, zh-Hant;q=0.5</Value>
      </Item>
      <Item>
         <Name>HTTP_COOKIE</Name>
         <Value>ASP.NET_SessionId=swk3hhreeldb4s5uur2vrxtm; PCLanguage=Code=en; PcLogin=Type=Parent</Value>
      </Item>
      <Item>
         <Name>HTTP_HOST</Name>
         <Value>gradespeed.austinisd.org</Value>
      </Item>
      <Item>
         <Name>HTTP_USER_AGENT</Name>
         <Value>QuickHAC/3A1 (iPhone; iOS 7.0.2; Scale/2.00)</Value>
      </Item>
   </ServerVariables>
</ErrorReport>

Basically I think something broke in the login process and it's being totally fucking moronic and can't handle the damn switch right because it seems to throw a student ID at it that's one of the other logged-in users rather than what you just entered. Holy hell why am I doing this ugh

tristanseifert commented 10 years ago

Caused by an issue in SQULoginViewController not switching the student if there's already a student in the database — a butchered fix to suppress the SQUGradesDataUpdatedNotification notification so we don't corrupt the views with this temporary data.