/opt/dedrads/cms_tools/__pycache__
NameSizeModeActions
cms.cpython-313.pyc226940644editdlrm
common.cpython-313.pyc51370644editdlrm
db.cpython-313.pyc210570644editdlrm
helpers.cpython-313.pyc239580644editdlrm
__init__.cpython-313.pyc1310644editdlrm
Edit: /opt/dedrads/cms_tools/__pycache__/cms.cpython-313.pyc (22694B)
}jKSrSSKrSSKrSSKrSSKJrJrJrJrJ r J r J r J r J r \R"\5r"SS\5r"SS5r"SS 5r"S S 5r"S S \5rSSSjjr"SS5rSSKrg)z^CMS class and associated classes. Used to find CMS and present methods for their manipulation.N) backup_file restore_file restore_dbreadfilestrip_php_commentsfind_php_define find_php_var php_re_define php_re_assignc,^\rSrSrSrU4SjrSrU=r$)CMSErrorzError class for CMSc4>U4Ul[TU] X5 gN)argssuper__init__)selfarg __class__s /opt/dedrads/cms_tools/cms.pyrCMSError.__init__sF  #)r)__name__ __module__ __qualname____firstlineno____doc__r__static_attributes__ __classcell__)rs@rr r s$$rr c:\rSrSrSrSrSrSrS SjrSr Sr S r g) VariableData$z; Class to define where a variable is set and manipulate it constNc(XlX0lX lg)z1 Allow for initialization with or without values N)typefilevalue)r variable_typer)filenames rrVariableData.__init__-s"   rcSUR:Xa UR$[UR5nSULa[R S5 gSUR:XaD[ U5n[URU5n[RSURU5 U$SUR:Xa![ U5n[URU5$[R SUR5 g)z/ Return the value of the indicated by the data r$NzCould not get value php_definezGot php define %s = %s php_variable!Variable type '%s' not recognized) r'r)rr(LOGGERwarningrrdebugr )r file_data new_values r get_valueVariableData.get_value5s dii :: TYY' 9  NN0 1 499 $*95I' I>I LL14::y I  TYY &*95I I6 6:DIIFrc2SUR:XaXlgSUR:Xa [URXR5$SUR:Xa [ URXR5$[ R SUR5 g)z- Set a new value and update appropriate file r$Tr.r/r0F)r'r)r r(r r1r2)rr5s r set_valueVariableData.set_valueNsp dii "J 499 $ Y B B TYY & Y B B:DIIFr)r(r'r))r$r%N) rrrrrr'r(r)rr6r9rrrr"r"$s' D D E2 rr"c<\rSrSrSrSrSrSrSrSr Sr S r S r S r S rg ) CMSStatuscz*Status of CMS. Negative values are errors.rr;N)rrrrrdb_has_matching_tables db_has_tablesdb_is_connecting db_is_set initiated uninitiatedr2errorcriticalrr;rrr=r=cs44MIIKG EHrr=c\rSrSrSrSrSr\Rr \Rr Sr Sr Sr SrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"S r#S r$Sr%0r&0r'/r(S r)SS jr*S r+S r,Sr-Sr.Sr/Sr0Sr1Sr2Sr3Sr4Sr5g)CMSqz" Base class for CMS installations r;rrLNr%FUnknownc[SS5Ul[SS5Ul[SS5Ul[SS5Ulg)z{{DK NNH  )00 OO KK FF/$++=##   zz|| LL3 ##      yyk/0C0C/D E rc URSs=:aU:a:O O7[RSURUUR5 [ S5eUSs=:aUR::aO OURUlXlX lU[ R:Xa"[RSURU5 OkU[ R:Xa"[RSURU5 O5U[ R:Xa![RSURU5 [RSURURUR5 U[ RLaUR5 gg)zSet new status for CMSrzdAttempting to increase status when error exists. Attempting to change from %d to %d. Last status: %szUnhandled errorz%s: %szSet status of %s to %d: %sN) statusr1rNreasonr previous_statusr=rMrer2r3rGpost_tables_hook)r new_statusrys rrrCMS.set_statuss ;; 'Z ' OOF   ,- -  (T[[ (#';;D    ( LL4#6#6 ? 9,, , NN8T%8%8& A 9-- - OOHd&9&96 B (    KK KK   99 9  ! ! # :rcb[RSUR5 [UR5S:XdWURR 5H9up[ X!5(aM[RSU5 [SU-5e [UR5S:XdxURR 5HZup4[URURURU5(aM8[RSU5 [SU-5e 0Ul0Ul g)z' Revert changes attempted on this run. z Reverting %srzCould not restore %s!T)r1inforerhr`itemsrrNr rardb_userdb_passdb_name)r orig_filenew_filedatabase dump_paths rrevert CMS.revert(s  ND$7$784&&'1,'+':':'@'@'B# #H88OO$;YG"#:Y#FGG(C 4$$%*'+'8'8'>'>'@#!LLLLLL  OO$;XF"#:X#EFF(A!rcSnUS:Xa URnOpUS:Xa URnO]US:Xa URnOJUS:Xa URnO7US:Xa URnO$UR [ RSU-5 gUc$UR [ RS U-5 gURnX@R;af[U5nU(d0UR [ RS RXA55 g[RS U5 XPRU'URU5 g ) z< Safely set a cms variable, keeping track of modified files Nrrrdb_prefdb_hostUknown variable type '%s'.FVariable '%s' was not set.z%Could not backup {}. Cannot modify {}z Modifying %sT)rTrUrVrWrnrrr=r2r(r`rrMror1rr9)r cms_variabler) variable_data config_filers r set_variableCMS.set_variableEs,  9 $ --M Y & --M Y & --M Y & --M Y & --M OO!!#?,#N   OO!!#?,#N #(( 11 1";/HOO;BB#  KK 4/7   ,&rcFSnUS:Xa URnOcUS:Xa URnOPUS:Xa URnO=US:Xa URnO*US:Xa URnO[ R SU5 gUc[ R S U5 gUR5$) z4 Get a cms variable. Just a wrapper for consistency NrrrrrrFr)rTrUrVrWrnr1r2r6)rrrs r get_variableCMS.get_variableus  9 $ --M Y & --M Y & --M Y & --M Y & --M NN7 F  NN7 F&&((rcBSURURURURUR4;a![ R SUR5 gURS5Ul URS5Ul URS5Ul URS5Ul URS5Ul URUlURUlURUlURUlURUlSURURURURUR4;a!UR'[(R*S 5 gUR'[(R,S 5 g ) z Get database credentials NzLDatabase information for %s was not set! This should have already been done.FrrrrrzDatabase credentials not setzDatabase credentials setT)rTrUrVrWrnr1rMrerrrrrr orig_db_name orig_db_user orig_db_pass orig_db_pref orig_db_hostrrr=r2rJrXs rrsCMS.set_db_credssW                    LL6##  ((3 ((3 ((3 ((3 ((3  LL LL LL LL LL  LL LL LL LL LL    OOI--/M N  ++-GHrcU(dg[RRU5(d"[R SUR U5 gU4Ul[RSUR U5 g)zn Replace Database search path with specified directory if it exists. Return True if reset or False otherwise. Fz>Database search path not reset for %s. '%s' is not a directoryz%Database search path for %s set to %sT)rbpathisdirr1r2rqrlr)rdumppaths rset_db_search_pathCMS.set_db_search_pathsc ww}}X&& NN*    $,;  3T\\8 rc[SUR-5 [SUR-5 [SUR-5 [SUR-5 [SUR -5 g)z" Display the database credentials zDatabse Name: %sz Username: %sz Password: %szTable Prefix: %szHost: %sN)printrrrrrrXs r show_credsCMS.show_credss[  4<</0 nt||+, nt||+,  4<</0 j4<<'(rc[UR5S:Xa"[RSUR5 U$/nX!- nUHBnURH/nS[ R "XC5LdMURU5 M1 MD U$)z) Remove cms directories from the dirlist rz'No directories to purge for CMS type %sN)rhcms_directoriesr1r3r'rfrmremove)rdirlist new_dirlistrt expressions r purge_dirlistCMS.purge_dirlists t## $ ) LLBDII NN  $M"22 ryyCC&&}53%rcD[RSUR5 g)z/Perform operatons which need a working databasez8CMS type %s has nothing to do after tables are availableT)r1r3r'rXs rr{CMS.post_tables_hooks F II rc<URUlUR$)zP Get the siteurl for the CMS. If the CMS doesn't have this ability, use tempurl )rqsiteurlrXs r get_siteurlCMS.get_siteurls || ||r)rirlrrnrrTrrVrrWrrUrjrer_rar`rrrrrrzryrdrrxrq)r)6rrrrrrlr_r=rLrxrzryrer'configrirj is_db_setis_db_connectingrTrUrVrWrnrrrrrrrrrrrdrversionrqr`rarrYrrrrrrrsrrrr{rrr;rrrPrPqs F  " "F++O FN DFFHILLLLLGGGGGLLLLLJGGGNLOJ\"$H:.`)6*\0 )2rrPc\rSrSrSrSrSrg) UnknownCMSiz$ Class for unkown CMS installations cSUlSUl[SS5Ul[SS5Ul[SS5Ul[SS5Ulg)NrRr%r$T)r'rr"rTrUrVrWrXs rrYUnknownCMS.setupsQ  )"5("5("5("5r)rrTrVrWrUr'N)rrrrrrYrr;rrrrs  rrCMSFindc[[R5Vs/sHo"RS5(aMUPM nn/nUHsnUbXQ;a[R SU5 M#[ [RU5RU5 [R SU5 URU5 Mu U$s snf)zO Load additional CMS modules, accepting a list to include only certain modules _zSkipping module %szRegistered module: %s) dir cms_toolsmods startswithr1r3getattr register_cmsappend)cms_find include_listx mod_namesavailable_modsmod_names r load_modulesr)s  /I/q||C7H/IIN  #(D LL-x 8  )66x@ ,h7h' Js B>B>cB\rSrSrSrSr0rS SjrSrSr Sr S r S r g) ri=z( Class to search for CMS in a directory FNc(X0lXlX lg)zF Initiate CMSFind object, setting search parameters and interactivity N) interactivity start_path search_depth)rrrrs rrCMSFind.__init__Es +$(rc@XR;agX RU'g)zy Add informaiton for a quick search. search_token is searched in index.php class_reference is used to create the new CMS FN) quick_search)r search_tokenclass_references r add_quickCMSFind.add_quickNs$ ,, ,*9,'rc[RRUS5n[RRU5(dg[ U5nUR R 5HhupES[R"XC5LdM U"XR5nUR[R:aUs $URS:dMfUs $ [U5$)z Perform a quick search for the CMS. Simply search index.php for specified string. Return CMS object if one is found, or None. z index.phpNr)rbrjoinisfilerrrrfrmrrxr=rLr)rrtindex_filename index_filer class_refnew_cmss rquick CMSFind.quick[sm[Aww~~n--n- '+'8'8'>'>'@ #L299\>>#M3E3EF>>I$9$99"N>>A%"N (A-((rc#># SU:Xag[RRU5(dgSH$n[R"SU-U5(dM$ g [ R SX5 [R"U5nURU5nSULaURU5nUv UHdn[RRX5n[RRU5(dMHURXrS- 5ShvN Mf gN 7f)zk Generator to return CMS installations. Starting at path, find CMS instances down to depth subdirectories. rN)virtfsz\.[^/]*zcgi-binwwwmailetcz access-logstmpbinz perl[0-9]*phpsslcachez cpanel[^/]*z \bbac?k\bbackupz\bold\bz\bnew\bz \bte?mp\bxmlrpcz/%s$z(checking path: %s, Depth from bottom: %drC) rbrrrfrmr1r3listdirrrr find_in_path)r current_pathdepth exclude_rxsubdirsrrt next_paths rrCMSFind.find_in_pathts : ww}}\**  J,yy*,l;;/ 2  6  **\***\* w ++G4GM$M \AIww}}\**,,Y BBB%CsADB!D:DD Dc## URcS5eURS:a[RS5 gUR URUR5HnSUR :wdMUv M g7f)zR Main find function, starting from start path and depth, returning only known CMS NzStart path not setrCz-Attempting to search with a depth less than 1rR)rrr1rMrr')rthe_cmss rfind_cmsCMSFind.find_cmssn *@,@@*   q LLH I (($:K:KLGGLL( Ms A2B8 B)rrr)Nrr) rrrrrrrrrrrrrr;rrrr=s.ML) )25Cn rr)rr)rrbrfloggingcms_tools.helpersrrrrrrr r r getLoggerrr1 Exceptionr r"r=rPrrrcms_tools.modsrr;rrrs@       8 $ $y$66~  [[B .({{Br