ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mnet/xmlrpc/xmlparser.php000064400000030102152266562600023665 0ustar00initialise(); } /** * Old syntax of class constructor. Deprecated in PHP7. * * @deprecated since Moodle 3.1 */ public function mnet_encxml_parser() { debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER); self::__construct(); } /** * Set default element handlers and initialise properties to empty. * * @return bool True */ function initialise() { $this->parser = xml_parser_create(); xml_set_element_handler($this->parser, [$this, "start_element"], [$this, "end_element"]); xml_set_character_data_handler($this->parser, [$this, "discard_data"]); $this->tag_number = 0; // Just a unique ID for each tag $this->digest = ''; $this->remote_timestamp = ''; $this->remote_wwwroot = ''; $this->signature = ''; $this->data_object = ''; $this->key_URI = ''; $this->payload_encrypted = false; $this->cipher = array(); $this->error = array(); $this->remoteerror = null; $this->errorstarted = false; return true; } /** * Parse a block of XML text * * The XML Text will be an XML-RPC request which is wrapped in an XML doc * with a signature from the sender. This envelope may be encrypted and * delivered within another XML envelope with a symmetric key. The parser * should first decrypt this XML, and then place the XML-RPC request into * the data_object property, and the signature into the signature property. * * See the W3C's {@link http://www.w3.org/TR/xmlenc-core/ XML Encryption Syntax and Processing} * and {@link http://www.w3.org/TR/2001/PR-xmldsig-core-20010820/ XML-Signature Syntax and Processing} * guidelines for more detail on the XML. * * -----XML-Envelope--------------------------------- * | | * | Symmetric-key-------------------------- | * | |_____________________________________| | * | | * | Encrypted data------------------------- | * | | | | * | | -XML-Envelope------------------ | | * | | | | | | * | | | --Signature------------- | | | * | | | |______________________| | | | * | | | | | | * | | | --Signed-Payload-------- | | | * | | | | | | | | * | | | | XML-RPC Request | | | | * | | | |______________________| | | | * | | | | | | * | | |_____________________________| | | * | |_____________________________________| | * | | * |________________________________________________| * * @param string $data The XML that you want to parse * @return bool True on success - false on failure */ function parse($data) { $p = xml_parse($this->parser, $data); if ($p == 0) { // Parse failed $errcode = xml_get_error_code($this->parser); $errstring = xml_error_string($errcode); $lineno = xml_get_current_line_number($this->parser); if ($lineno !== false) { $error = array('lineno' => $lineno); $lineno--; // Line numbering starts at 1. while ($lineno > 0) { $data = strstr($data, "\n"); $lineno--; } $data .= "\n"; // In case there's only one line (no newline) $line = substr($data, 0, strpos($data, "\n")); $error['code'] = $errcode; $error['string'] = $errstring; $error['line'] = $line; $this->error[] = $error; } else { $this->error[] = array('code' => $errcode, 'string' => $errstring); } } if (!empty($this->remoteerror)) { return false; } if (count($this->cipher) > 0) { $this->cipher = array_values($this->cipher); $this->payload_encrypted = true; } return (bool)$p; } /** * Destroy the parser and free up any related resource. */ function free_resource() { $free = xml_parser_free($this->parser); } /** * Set the character-data handler to the right function for each element * * For each tag (element) name, this function switches the character-data * handler to the function that handles that element. Note that character * data is referred to the handler in blocks of 1024 bytes. * * @param mixed $parser The XML parser * @param string $name The name of the tag, e.g. method_call * @param array $attrs The tag's attributes (if any exist). * @return bool True */ function start_element($parser, $name, $attrs) { $this->tag_number++; $handler = 'discard_data'; switch(strtoupper($name)) { case 'DIGESTVALUE': $handler = 'parse_digest'; break; case 'SIGNATUREVALUE': $handler = 'parse_signature'; break; case 'OBJECT': $handler = 'parse_object'; break; case 'RETRIEVALMETHOD': $this->key_URI = $attrs['URI']; break; case 'TIMESTAMP': $handler = 'parse_timestamp'; break; case 'WWWROOT': $handler = 'parse_wwwroot'; break; case 'CIPHERVALUE': $this->cipher[$this->tag_number] = ''; $handler = 'parse_cipher'; break; case 'FAULT': $handler = 'parse_fault'; default: break; } xml_set_character_data_handler($this->parser, [$this, $handler]); return true; } /** * Add the next chunk of character data to the remote_timestamp string * * @param mixed $parser The XML parser * @param string $data The content of the current tag (1024 byte chunk) * @return bool True */ function parse_timestamp($parser, $data) { $this->remote_timestamp .= $data; return true; } /** * Add the next chunk of character data to the cipher string for that tag * * The XML parser calls the character-data handler with 1024-character * chunks of data. This means that the handler may be called several times * for a single tag, so we use the concatenate operator (.) to build the * tag content into a string. * We should not encounter more than one of each tag type, except for the * cipher tag. We will often see two of those. We prevent the content of * these two tags being concatenated together by counting each tag, and * using its 'number' as the key to an array of ciphers. * * @param mixed $parser The XML parser * @param string $data The content of the current tag (1024 byte chunk) * @return bool True */ function parse_cipher($parser, $data) { $this->cipher[$this->tag_number] .= $data; return true; } /** * Add the next chunk of character data to the remote_wwwroot string * * @param mixed $parser The XML parser * @param string $data The content of the current tag (1024 byte chunk) * @return bool True */ function parse_wwwroot($parser, $data) { $this->remote_wwwroot .= $data; return true; } /** * Add the next chunk of character data to the digest string * * @param mixed $parser The XML parser * @param string $data The content of the current tag (1024 byte chunk) * @return bool True */ function parse_digest($parser, $data) { $this->digest .= $data; return true; } /** * Add the next chunk of character data to the signature string * * @param mixed $parser The XML parser * @param string $data The content of the current tag (1024 byte chunk) * @return bool True */ function parse_signature($parser, $data) { $this->signature .= $data; return true; } /** * Add the next chunk of character data to the data_object string * * @param mixed $parser The XML parser * @param string $data The content of the current tag (1024 byte chunk) * @return bool True */ function parse_object($parser, $data) { $this->data_object .= $data; return true; } /** * Discard the next chunk of character data * * This is used for tags that we're not interested in. * * @param mixed $parser The XML parser * @param string $data The content of the current tag (1024 byte chunk) * @return bool True */ function discard_data($parser, $data) { if (!$this->errorstarted) { // Not interested return true; } $data = trim($data); if (isset($this->errorstarted->faultstringstarted) && !empty($data)) { $this->remoteerror .= ', message: ' . $data; } else if (isset($this->errorstarted->faultcodestarted)) { $this->remoteerror = 'code: ' . $data; unset($this->errorstarted->faultcodestarted); } else if ($data == 'faultCode') { $this->errorstarted->faultcodestarted = true; } else if ($data == 'faultString') { $this->errorstarted->faultstringstarted = true; } return true; } function parse_fault($parser, $data) { $this->errorstarted = new StdClass; return true; } /** * Switch the character-data handler to ignore the next chunk of data * * @param mixed $parser The XML parser * @param string $name The name of the tag, e.g. method_call * @return bool True */ function end_element($parser, $name) { $ok = xml_set_character_data_handler($this->parser, [$this, "discard_data"]); return true; } }