<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="system">
        <name>plg_system_log_teacher</name>
        <author>arti shrivas</author>
        <creationDate>nov 8 2013</creationDate>

        <license>GNU General Public License</license>
        <authorEmail>bradm@inmotionhosting.com</authorEmail>
        <authorUrl>http://www.inmotionhosting.com</authorUrl>
        <version>1.0</version>
        <description>simple system plugin.</description>
        <files>
                <filename plugin="log_teacher">log_teacher.php</filename>
                <filename>index.html</filename>
        </files>
</extension>

this is my plugin xml file

<?php

// no direct access
defined('_JEXEC') or die;

class plgSystemLog_Teacher extends JPlugin
{
    public function onTeacherlogin()
        {
          // Get the application object.
          echo "hello";
          JPluginHelper::importPlugin( 'system' );
        $app = JFactory::getApplication();
                $user = JFactory::getUser();
                if(!$user){
                    echo "user not logged in";
                }
                else
                {
                    echo "user is".$user->id;   
                }
        }
}

?>

and this is my php file i create a plugin for displaying login user and then i have to detemine the user belogn to witch group if user is teacher then i have to redirect it to quiz section but problem is that plugin not display log in user what is the problem is this plugin its my first plugin please help me out..

Member Avatar for LastMitch

and this is my php file i create a plugin for displaying login user and then i have to detemine the user belogn to witch group if user is teacher then i have to redirect it to quiz section but problem is that plugin not display log in user what is the problem is this plugin its my first plugin please help me out..

@AARTI SHRIVAS

Post your link of your joomla plugin. You missing more than a few lines.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.