0
<?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..

2
Contributors
1
Reply
8
Views
3 Years
Discussion Span
Last Post by LastMitch
0

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.

Edited by LastMitch

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.