Skip to main content
edited tags
Link
sv3n
  • 11.7k
  • 7
  • 41
  • 73
added 48 characters in body
Source Link
Ciprian
  • 527
  • 2
  • 17
<config>
<modules>
    <AdminChat><Blugento_AdminChat>
        <version>1.0.0</version>
    </AdminChat>Blugento_AdminChat>
</modules>
<global>
    <helpers>
        <adminchat><blugento_adminchat>
            <class>AdminChat_Helper< <class>Blugento_AdminChat_Helper</class>
        </adminchat>blugento_adminchat>
    </helpers>
</global>
<adminhtml>
    <acl>
        <resources>
            <all>
                 <title>Allow Everything</title>
            </all>
            <admin>
                 <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <adminchat>
                                        <title>AdminChat</title>
                                    </adminchat>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>
</config>
<config>
<modules>
    <AdminChat>
        <version>1.0.0</version>
    </AdminChat>
</modules>
<global>
    <helpers>
        <adminchat>
            <class>AdminChat_Helper</class>
        </adminchat>
    </helpers>
</global>
<adminhtml>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <adminchat>
                                        <title>AdminChat</title>
                                    </adminchat>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>
</config>
<config>
<modules>
    <Blugento_AdminChat>
        <version>1.0.0</version>
    </Blugento_AdminChat>
</modules>
<global>
    <helpers>
        <blugento_adminchat>
             <class>Blugento_AdminChat_Helper</class>
        </blugento_adminchat>
    </helpers>
</global>
<adminhtml>
    <acl>
        <resources>
            <all>
                 <title>Allow Everything</title>
            </all>
            <admin>
                 <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <adminchat>
                                        <title>AdminChat</title>
                                    </adminchat>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>
</config>
Source Link
Ciprian
  • 527
  • 2
  • 17

Warning: include(Cm/Cache/Backend/Redis.php): failed to open stream: No such file or directory

I created a new custom module on my magento 1.9 website. After I installed it I got this error on my system.log file: Warning: include(Cm/Cache/Backend/Redis.php): failed to open stream: No such file or directory, and from that moment my magento admin panel displays only a blank page, without any errors, o console errors. I don't know what happened. I had only a few files in my modules: config.xml

<config>
<modules>
    <AdminChat>
        <version>1.0.0</version>
    </AdminChat>
</modules>
<global>
    <helpers>
        <adminchat>
            <class>AdminChat_Helper</class>
        </adminchat>
    </helpers>
</global>
<adminhtml>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <adminchat>
                                        <title>AdminChat</title>
                                    </adminchat>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>
</config>

footer.phtml this will overwrite the footer from the magento admin panel and will add the last to scripts from the bottom of the file:

<p class="bug-report">
     <a href="<?php echo $this->getBugreportUrl() ?>" id="footer_bug_tracking"><?php echo $this->__('Help Us Keep Magento Healthy - Report All Bugs') ?></a><br/>
     <?php echo $this->__('Interface Locale: %s', $this->getLanguageSelect()) ?>
</p>
<p class="legality">
     <a href="<?php echo $this->getConnectWithMagentoUrl() ?>" id="footer_connect"><?php echo $this->__('Connect with the Magento Community') ?></a><br/>
     <img src="<?php echo $this->getSkinUrl('images/varien_logo.gif') ?>" class="v-middle" alt="" />&nbsp;&nbsp;
     <?php echo $this->__('Magento&trade; is a trademark of Magento Inc.<br/>Copyright &copy; %s Magento Inc.', date('Y')) ?>
</p>
<?php echo $this->__('Magento ver. %s', Mage::getVersion()) ?>
<script type="text/javascript">
     $('footer_bug_tracking').target = 'Varien_External';
     $('footer_connect').target = 'Varien_External';
     function setInterfaceLanguage(evt){
     var elem = Event.element(evt);
     if(elem){
        setLocation('<?php echo $this->getChangeLocaleUrl() ?>locale/'elem.value'/<?php echo $this->getRefererParamName() ?>/<?php echo $this->getUrlForReferer() ?>');
     }
}
Event.observe('interface_locale', 'change', setInterfaceLanguage)
</script>
<?php if(Mage::helper('blugento_adminchat')->isEnabled() && Mage::helper('blugento_adminchat')->getEmail()):?>
<script>
    window.intercomSettings = {
        app_id: "<?php echo Mage::getStoreConfig('blugento_adminchat/general/app_id'); ?>",
        name: "<?php echo Mage::getSingleton('admin/session')->getUser()->getName(); ?>", // Full name
        email: "<?php echo Mage::helper('blugento_adminchat')->getEmail(); ?>", // Email address
        created_at: "<?php echo Mage::getStoreConfig('blugento_adminchat/general/customer_since'); ?>", // Signup Date
        shop_url: "<?php echo Mage::helper('blugento_adminchat')->getDomain(); ?>",
        shop_code: "<?php echo Mage::getStoreConfig('blugento_adminchat/general/shop_code'); ?>",
        user_hash: "<?php
            echo hash_hmac(
                'sha256', // hash function
                Mage::helper('blugento_adminchat')->getEmail(), // user's email address
                'zIHDTOn6oDiZNrdb_qRRMoO-oLNEg-yeubFZ5sU1' // secret key (keep safe!)
            );
            ?>"
    };
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/fmjefzxq';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
</script>
<?php endif; ?>

And the last file is Data.php from helper folder:

class Blugento_Adminchat_Helper_Data extends Mage_Core_Helper_Abstract
{
const XML_PATH_ENABLED = 'blugento_adminchat/general/enable';

/**
 * Check if module is enabled
 *
 * @return int
 */
public function isEnabled()
{
    return (int) Mage::getStoreConfig(self::XML_PATH_ENABLED);
}

public function getEmail(){

    $user = Mage::getSingleton('admin/session');
    $userEmail = $user->getUser()->getEmail();

    $authorizedEmails = Mage::getStoreConfig('blugento_adminchat/general/authorized_external_emails');
    $authorizedEmails = explode(',', $authorizedEmails);

    foreach($authorizedEmails as $key => $email){
        $email = trim($email);
        $authorizedEmails[$key] = $email;
    }

    if($this->checkEmail($userEmail) || in_array($userEmail, $authorizedEmails)){
        return $userEmail;
    }else{
        return false;
    }
}

public function getDomain(){
    $domain = Mage::getBaseUrl (Mage_Core_Model_Store::URL_TYPE_WEB);

    $domain = str_replace('http://', '', $domain);
    $domain = str_replace('https://', '', $domain);
    $domain = str_replace('www.', '', $domain);
    if($domain[strlen($domain)-1] == '/'){
        $domain = substr($domain, 0, -1);
    }
    return $domain;
}

public function checkEmail($email){
    $domains = array('domain.ro', 'domain.eu');

    $domain = $this->getDomain();
    $email = trim($email);

    $emailDomain = explode('@', $email);
    $emailDomain = $emailDomain[count($emailDomain)-1];

    if($emailDomain == $domain  && !in_array($emailDomain, $domains)){
        return true;
    }else{
        return false;
    }
  }
}

And the other two files are system.xml and Adminchat.xml, but I think these two are not relevant. Can anyone tell me if the code is wrong and how to make my magento admin panel to work again, because now I can't access it. I deleted the cache and don't know what else to do now. Can you help please?