....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 195.3.193.30  /  Your IP : 216.73.216.125
Web Server : Apache
System : Linux server3 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User : web032 ( 1035)
PHP Version : 7.3.33
Disable Function : show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/web032/htdocs/cms/plugins/system/easycalccheckplus/easycalccheckplus/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/web032/htdocs/cms/plugins/system/easycalccheckplus/easycalccheckplus/mollom.php
<?php
/**
 * @Copyright
 * @package     EasyCalcCheck Plus
 * @author      Viktor Vogel {@link http://www.kubik-rubik.de}
 * @link        Project Site {@link http://joomla-extensions.kubik-rubik.de/ecc-easycalccheck-plus}
 *
 * Mollom class
 *
 * This source file can be used to communicate with mollom (http://mollom.com)
 *
 * @author      Tijs Verkoyen <mollom@verkoyen.eu>
 * @version     1.1.3
 *
 * @copyright   Copyright (c) 2008, Tijs Verkoyen. All rights reserved.
 * @license     http://mollom.local/license BSD License
 */
defined('_JEXEC') or die('Restricted access');

class Mollom
{
    /**
     * The allowed reverse proxy addresses
     *
     * @var	array
     */
    private static $allowedReverseProxyAddresses = array();

    /**
     * Your private key
     *
     * Set it by calling Mollom::setPrivateKey('<your-key>');
     *
     * @var	string
     */
    private static $privateKey;

    /**
     * Your public key
     *
     * Set it by calling Mollom::setPublicKey('<your-key>');
     *
     * @var	string
     */
    private static $publicKey;

    /**
     * Reverse proxy allowed?
     *
     * @var	bool
     */
    private static $reverseProxy = false;

    /**
     * The default server
     *
     * No need to change
     *
     * @var	string
     */
    private static $serverHost = 'xmlrpc.mollom.com';

    /**
     * The cache for the serverlist
     *
     * No need to change
     *
     * @var	array
     */
    private static $serverList = array();

    /**
     * Default timeout
     *
     * @var	int
     */
    private static $timeout = 10;

    /**
     * The default user-agent
     *
     * Change it by calling Mollom::setUserAgent('<your-user-agent>');
     *
     * @var	string
     */
    private static $userAgent = 'MollomPHP/1.1.3';

    /**
     * The current Mollom-version
     *
     * No need to change
     *
     * @var	string
     */
    private static $version = '1.0';

    /**
     * Build the value so we can use it in XML-RPC requests
     *
     * @return	string
     * @param	mixed $value
     */
    private function buildValue($value)
    {
        // get type
        $type = gettype($value);

        // build value
        switch($type)
        {
            case 'string':
                // escape it, cause Mollom can't handle CDATA (no pun intended)
                $value = htmlspecialchars($value, ENT_QUOTES, 'ISO-8859-15');
                return '<value><string>'.$value.'</string></value>'."\n";

            case 'array':
                // init struct
                $struct = '<value>'."\n";
                $struct .= '	<struct>'."\n";

                // loop array
                foreach($value as $key => $value)
                    $struct .= str_replace("\n", '', '<member>'."\n".'<name>'.$key.'</name>'.self::buildValue($value).'</member>')."\n";

                $struct .= '	</struct>'."\n";
                $struct .= '</value>'."\n";

                // return
                return $struct;

            default:
                return '<value>'.$value.'</value>'."\n";
        }
    }

    /**
     * Validates the answer for a CAPTCHA
     *
     * When the answer is false, you should request a new image- or audio-CAPTCHA, make sure your provide the current Mollom-sessionid.
     * The sessionid will be used to track spambots that try to solve CAPTHCA's by brute force.
     *
     * @return	bool
     * @param	string $sessionId
     * @param	string $solution
     */
    public static function checkCaptcha($sessionId, $solution)
    {
        // redefine
        $sessionId = (string) $sessionId;
        $solution = (string) $solution;

        // set autor ip
        $authorIp = self::getIpAddress();

        // set parameters
        $parameters['session_id'] = $sessionId;
        $parameters['solution'] = $solution;
        if($authorIp != null)
            $parameters['author_ip'] = (string) $authorIp;

        // do the call
        $responseString = self::doCall('checkCaptcha', $parameters);
        // validate
        if(!isset($responseString->params->param->value->boolean))
            throw new Exception('Invalid response in checkCapthca.');

        // return
        if((string) $responseString->params->param->value->boolean == '1')
            return true;

        // fallback
        return false;
    }

    /**
     * Check if the data is spam or not, and gets an assessment of the datas quality
     *
     * This function will be used most. The more data you submit the more accurate the claasification will be.
     * If the spamstatus is 'unsure', you could send the user an extra check (eg. a captcha).
     *
     * REMARK: the Mollom-sessionid is NOT related to HTTP-session, so don't send 'session_id'.
     *
     * The function will return an array with 3 elements:
     * - spam			the spam-status (unknown/ham/spam/unsure)
     * - quality		an assessment of the content's quality (between 0 and 1)
     * - session_id		Molloms session_id
     *
     * @return	array
     * @param	string[optional] $sessionId
     * @param	string[optional] $postTitle
     * @param	string[optional] $postBody
     * @param	string[optional] $authorName
     * @param	string[optional] $authorUrl
     * @param	string[optional] $authorEmail
     * @param	string[optional] $authorOpenId
     * @param	string[optional] $authorId
     */
    public static function checkContent($sessionId = null, $postTitle = null, $postBody = null, $authorName = null, $authorUrl = null, $authorEmail = null, $authorOpenId = null, $authorId = null)
    {
        // validate
        if($sessionId === null && $postTitle === null && $postBody === null && $authorName === null && $authorUrl === null && $authorEmail === null && $authorOpenId === null && $authorId === null)
            throw new Exception('Specify at least on argument');

        // init var
        $parameters = array();
        $aReturn = array();

        // add parameters
        if($sessionId !== null)
            $parameters['session_id'] = (string) $sessionId;
        if($postTitle !== null)
            $parameters['post_title'] = (string) $postTitle;
        if($postBody !== null)
            $parameters['post_body'] = (string) $postBody;
        if($authorName !== null)
            $parameters['author_name'] = (string) $authorName;
        if($authorUrl !== null)
            $parameters['author_url'] = (string) $authorUrl;
        if($authorEmail !== null)
            $parameters['author_mail'] = (string) $authorEmail;
        if($authorOpenId != null)
            $parameters['author_openid'] = (string) $authorOpenId;
        if($authorId != null)
            $parameters['author_id'] = (string) $authorId;

        // set autor ip
        $authorIp = self::getIpAddress();
        if($authorIp != null)
            $parameters['author_ip'] = (string) $authorIp;

        // do the call
        $responseString = self::doCall('checkContent', $parameters);

        // validate
        if(!isset($responseString->params->param->value->struct->member))
            throw new Exception('Invalid response in checkContent.');

        // loop parts
        foreach($responseString->params->param->value->struct->member as $part)
        {
            // get key
            $key = $part->name;

            // get value
            switch($part->name)
            {
                case 'spam':
                    $value = (string) $part->value->int;

                    switch($value)
                    {
                        case '0':
                            $aReturn['spam'] = 'unknown';
                            break;

                        case '1':
                            $aReturn['spam'] = 'ham';
                            break;

                        case '2':
                            $aReturn['spam'] = 'spam';
                            break;

                        case '3':
                            $aReturn['spam'] = 'unsure';
                            break;
                    }
                    break;

                case 'quality':
                    $aReturn['quality'] = (float) $part->value->double;
                    break;

                case 'session_id':
                    $aReturn['session_id'] = (string) $part->value->string;
                    break;
            }
        }

        // return
        return $aReturn;
    }

    /**
     * Make the call
     *
     * @return	SimpleXMLElement
     * @param	string $method
     * @param	array[optional] $parameters
     */
    private static function doCall($method, $parameters = array(), $server = null, $counter = 0)
    {
        // count available servers
        $countServerList = count(self::$serverList);

        if($server === null && $countServerList == 0)
            throw new Exception('No servers found, populate the serverlist. See setServerList().');

        // redefine var
        $method = (string) $method;
        $parameters = (array) $parameters;

        // possible methods
        $aPossibleMethods = array('checkCaptcha', 'checkContent', 'getAudioCaptcha', 'getImageCaptcha', 'getServerList', 'getStatistics', 'sendFeedback', 'verifyKey');

        // check if method is valid
        if(!in_array($method, $aPossibleMethods))
            throw new Exception('Invalid method. Only '.implode(', ', $aPossibleMethods).' are possible methods.');

        // check if public key is set
        if(self::$publicKey === null)
            throw new Exception('Public key wasn\'t set.');

        // check if private key is set
        if(self::$privateKey === null)
            throw new Exception('Private key wasn\'t set.');

        // still null
        if($server === null)
            $server = self::$serverList[$counter];

        // cleanup server string
        $server = str_replace(array('http://', 'https://'), '', $server);

        // create timestamp
        $time = gmdate("Y-m-d\TH:i:s.\\0\\0\\0O", time());

        // create nonce
        $nonce = md5(time());

        // create has
        $hash = base64_encode(
                pack("H*", sha1((str_pad(self::$privateKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))).
                                pack("H*", sha1((str_pad(self::$privateKey, 64, chr(0x00)) ^ (str_repeat(chr(0x36), 64))).
                                                $time.':'.$nonce.':'.self::$privateKey))))
        );

        // add parameters
        $parameters['public_key'] = self::$publicKey;
        $parameters['time'] = $time;
        $parameters['hash'] = $hash;
        $parameters['nonce'] = $nonce;

        // build request
        $requestBody = '<?xml version="1.0"?>'."\n";
        $requestBody .= '<methodCall>'."\n";
        $requestBody .= '	<methodName>mollom.'.$method.'</methodName>'."\n";
        $requestBody .= '	<params>'."\n";
        $requestBody .= '		<param>'."\n";
        $requestBody .= '			'.self::buildValue($parameters)."\n";
        $requestBody .= '		</param>'."\n";
        $requestBody .= '	</params>'."\n";
        $requestBody .= '</methodCall>'."\n";

        // create curl
        $curl = @curl_init();

        // set useragent
        @curl_setopt($curl, CURLOPT_USERAGENT, self::$userAgent);

        // set options
        @curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
        @curl_setopt($curl, CURLOPT_POST, true);
        @curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
        @curl_setopt($curl, CURLOPT_HEADER, true);
        @curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        @curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, self::$timeout);
        @curl_setopt($curl, CURLOPT_TIMEOUT, self::$timeout);

        // set url
        @curl_setopt($curl, CURLOPT_URL, $server.'/'.self::$version);

        // set body
        @curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);

        // get response
        $response = @curl_exec($curl);

        // get errors
        $errorNumber = (int) @curl_errno($curl);
        $errorString = @curl_error($curl);

        // close
        @curl_close($curl);

        // validate response
        if($response === false || $errorNumber != 0)
        {
            // increment counter
            $counter++;

            // no servers left
            if($errorNumber == 28 && !isset(self::$serverList[$counter]) && $countServerList != 0)
                throw new Exception('No more servers available, try to increase the timeout.');

            // timeout
            elseif($errorNumber == 28 && isset(self::$serverList[$counter]))
                return self::doCall($method, $parameters, self::$serverList[$counter], $counter);

            // other error
            else
                throw new Exception('Something went wrong. Maybe the following message can be handy.<br />'.$errorString, $errorNumber);
        }

        // process response
        $parts = explode("\r\n\r\n", $response);

        // validate
        if(!isset($parts[0]) || !isset($parts[1]))
            throw new Exception('Invalid response in doCall.');

        // get headers
        $headers = $parts[0];

        // rebuild body
        array_shift($parts);
        $body = implode('', $parts);

        // validate header
        $aValidHeaders = array('HTTP/1.0 200', 'HTTP/1.1 200');
        if(!in_array(substr($headers, 0, 12), $aValidHeaders))
            throw new Exception('Invalid headers.');

        // do some validation
        $responseXML = @simplexml_load_string($body);
        if($responseXML === false)
            throw new Exception('Invalid body.');

        if(isset($responseXML->fault))
        {
            $code = (isset($responseXML->fault->value->struct->member[0]->value->int)) ? (int) $responseXML->fault->value->struct->member[0]->value->int : 'unknown';
            $message = (isset($responseXML->fault->value->struct->member[1]->value->string)) ? (string) $responseXML->fault->value->struct->member[1]->value->string : 'unknown';

            // handle errors
            switch($code)
            {
                // code 1000 (Parse error or internal problem)
                case 1000:
                    throw new Exception('[error '.$code.'] '.$message, $code);

                // code 1100 (Serverlist outdated)
                case 1100:
                    throw new Exception('[error '.$code.'] '.$message, $code);

                // code 1200 (Server too busy)
                case 1200:
                    if(self::$serverList === null)
                        self::getServerList();

                    // do call again
                    return self::doCall($method, $parameters, self::$serverList[$counter], $counter++);
                    break;

                default:
                    throw new Exception('[error '.$code.'] '.$message, $code);
            }
        }

        // return
        return $responseXML;
    }

    /**
     * Get a CAPTCHA-mp3 generated by Mollom
     *
     * If your already called getAudioCaptcha make sure you provide at least the $sessionId. It will be used
     * to identify visitors that are trying to break a CAPTCHA with brute force.
     *
     * REMARK: the Mollom-sessionid is NOT related to HTTP-session, so don't send 'session_id'.
     *
     * The function will return an array with 3 elements:
     * - session_id		the session_id from Mollom
     * - url			the url to the mp3-file
     * - html			html that can be used on your website to display the CAPTCHA
     *
     * @return	array
     * @param	string[optional] $sessionId
     */
    public static function getAudioCaptcha($sessionId = null)
    {
        // init vars
        $aReturn = array();
        $parameters = array();

        // set autor ip
        $authorIp = self::getIpAddress();

        // set parameters
        if($sessionId != null)
            $parameters['session_id'] = (string) $sessionId;
        if($authorIp != null)
            $parameters['author_ip'] = (string) $authorIp;

        // do the call
        $responseString = self::doCall('getAudioCaptcha', $parameters);

        // validate
        if(!isset($responseString->params->param->value->struct->member))
            throw new Exception('Invalid response in getAudioCaptcha.');

        // loop elements
        foreach($responseString->params->param->value->struct->member as $part)
            $aReturn[(string) $part->name] = (string) $part->value->string;

        // add image html
        $aReturn['html'] = '<object type="audio/mpeg" data="'.$aReturn['url'].'" width="50" height="16">'."\n"
                ."\t".'<param name="autoplay" value="false" />'."\n"
                ."\t".'<param name="controller" value="true" />'."\n"
                .'</object>';

        // return
        return $aReturn;
    }

    /**
     * Get a CAPTCHA-image generated by Mollom
     *
     * If your already called getImageCaptcha make sure you provide at least the $sessionId. It will be used
     * to identify visitors that are trying to break a CAPTCHA with brute force.
     *
     * REMARK: the Mollom-sessionid is NOT related to HTTP-session, so don't send 'session_id'.
     *
     * The function will return an array with 3 elements:
     * - session_id		the session_id from Mollom
     * - url			the url to the image
     * - html			html that can be used on your website to display the CAPTCHA
     *
     * @return	array
     * @param	string[optional] $sessionId
     */
    public static function getImageCaptcha($sessionId = null)
    {
        // init vars
        $aReturn = array();
        $parameters = array();

        // set autor ip
        $authorIp = self::getIpAddress();

        // set parameters
        if($sessionId !== null)
            $parameters['session_id'] = (string) $sessionId;
        if($authorIp !== null)
            $parameters['author_ip'] = (string) $authorIp;

        // do the call
        $responseString = self::doCall('getImageCaptcha', $parameters);

        // validate
        if(!isset($responseString->params->param->value->struct->member))
            throw new Exception('Invalid response in getImageCaptcha.');

        // loop elements
        foreach($responseString->params->param->value->struct->member as $part)
            $aReturn[(string) $part->name] = (string) $part->value->string;

        // add image html
        $aReturn['html'] = '<img src="'.$aReturn['url'].'" alt="Mollom CAPTCHA" />';

        // return
        return $aReturn;
    }

    /**
     * Get the real IP-address
     *
     * @return	string
     */
    public static function getIpAddress()
    {
        // pre check
        if(!isset($_SERVER['REMOTE_ADDR']))
            return null;

        // get ip
        $ipAddress = $_SERVER['REMOTE_ADDR'];

        if(self::$reverseProxy)
        {
            if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
            {
                if(!empty(self::$allowedReverseProxyAddresses) && in_array($ipAddress, self::$allowedProxyAddresses, true))
                {
                    return array_pop(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']));
                }
            }

            // running in a cluster environment
            if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))
                return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];
        }

        // fallback
        return $ipAddress;
    }

    /**
     * Obtains a list of valid servers
     *
     * @return	array
     */
    public static function getServerList($counter = 0)
    {
        // do the call
        $responseString = self::doCall('getServerList', array(), self::$serverHost, $counter);

        // validate
        if(!isset($responseString->params->param->value->array->data->value))
            throw new Exception('Invalid response in getServerList.');

        // loop servers and add them
        foreach($responseString->params->param->value->array->data->value as $server)
            self::$serverList[] = (string) $server->string;

        if(count(self::$serverList) == 0)
            self::$serverList = array('http://xmlrpc3.mollom.com', 'http://xmlrpc2.mollom.com', 'http://xmlrpc1.mollom.com');

        // return
        return self::$serverList;
    }

    /**
     * Retrieve statistics from Mollom
     *
     * Allowed types are listed below:
     * - total_days				Number of days Mollom has been used
     * - total_accepted			Total of blocked spam
     * - total_rejected			Total accepted posts (not working?)
     * - yesterday_accepted		Amount of spam blocked yesterday
     * - yesterday_rejected		Number of posts accepted yesterday (not working?)
     * - today_accepted			Amount of spam blocked today
     * - today_rejected			Number of posts accepted today (not working?)
     *
     * @return	int
     * @param	string $type
     */
    public static function getStatistics($type)
    {
        // possible types
        $aPossibleTypes = array('total_days', 'total_accepted', 'total_rejected', 'yesterday_accepted', 'yesterday_rejected', 'today_accepted', 'today_rejected');

        // redefine
        $type = (string) $type;

        // validate
        if(!in_array($type, $aPossibleTypes))
            throw new Exception('Invalid type. Only '.implode(', ', $aPossibleTypes).' are possible types.');

        // do the call
        $responseString = self::doCall('getStatistics', array('type' => $type));

        // validate
        if(!isset($responseString->params->param->value->int))
            throw new Exception('Invalid response in getStatistics.');

        // return
        return (int) $responseString->params->param->value->int;
    }

    /**
     * Send feedback to Mollom.
     *
     * With this method you can help train Mollom. Implement this method if possible. The more feedback is provided the more accurate
     * Mollom will be.
     *
     * Allowed feedback-strings are listed below:
     * - spam			Spam or unsolicited advertising
     * - profanity		Obscene, violent or profane content
     * - low-quality	Low-quality content or writing
     * - unwanted		Unwanted, taunting or off-topic content
     *
     * @return	bool
     * @param	string $sessionId
     * @param	string $feedback
     */
    public static function sendFeedback($sessionId, $feedback)
    {
        // possible feedback
        $aPossibleFeedback = array('spam', 'profanity', 'low-quality', 'unwanted');

        // redefine
        $sessionId = (string) $sessionId;
        $feedback = (string) $feedback;

        // validate
        if(!in_array($feedback, $aPossibleFeedback))
            throw new Exception('Invalid feedback. Only '.implode(', ', $aPossibleFeedback).' are possible feedback-strings.');

        // build parameters
        $parameters['session_id'] = $sessionId;
        $parameters['feedback'] = $feedback;

        // do the call
        $responseString = self::doCall('sendFeedback', $parameters);

        // validate
        if(!isset($responseString->params->param->value->boolean))
            throw new Exception('Invalid response in sendFeedback.');

        // return
        if((string) $responseString->params->param->value->boolean == 1)
            return true;

        // fallback
        return false;
    }

    /**
     * Set the allowed reverse proxy Addresses
     *
     * @return	void
     * @param	array $addresses
     */
    public static function setAllowedReverseProxyAddresses($addresses)
    {
        // store allowed ip-addresses
        self::$allowedReverseProxyAddresses = (array) $addresses;

        // set reverse proxy
        self::$reverseProxy = (!empty($addresses)) ? true : false;
    }

    /**
     * Set the private key
     *
     * @return	void
     * @param	string $key
     */
    public static function setPrivateKey($key)
    {
        self::$privateKey = (string) $key;
    }

    /**
     * Set the public key
     *
     * @return	void
     * @param	string $key
     */
    public static function setPublicKey($key)
    {
        self::$publicKey = (string) $key;
    }

    /**
     * Set the server list
     *
     * @return	void
     * @param	array $servers
     */
    public static function setServerList($servers)
    {
        // redefine
        $server = (array) $servers;

        // loop servers
        foreach($servers as $server)
            self::$serverList[] = $server;
    }

    /**
     * Set timeout
     *
     * @return	void
     * @param	int $timeout
     */
    public static function setTimeOut($timeout)
    {
        // redefine
        $timeout = (int) $timeout;

        // validate
        if($timeout == 0)
            throw new Exception('Invalid timeout. Timeout shouldn\'t be 0.');

        // set property
        self::$timeout = $timeout;
    }

    /**
     * Set the user agent
     *
     * @return	void
     * @param	string $newUserAgent
     */
    public static function setUserAgent($newUserAgent)
    {
        self::$userAgent .= ' '.(string) $newUserAgent;
    }

    /**
     * Verifies your key
     *
     * Returns information about the status of your key. Mollom will respond with a boolean value (true/false).
     * False means that your keys is disabled or doesn't exists. True means the key is enabled and working properly.
     *
     * @return	bool
     */
    public static function verifyKey()
    {
        // do the call
        $responseString = self::doCall('verifyKey');

        // validate
        if(!isset($responseString->params->param->value->boolean))
            throw new Exception('Invalid response in verifyKey.');

        // return
        if((string) $responseString->params->param->value->boolean == '1')
            return true;

        // fallback
        return false;
    }

}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit