Displaying Log off link

To display Log off link, e.g. “Welcome username Log off“:

Setup.TS


lib.welcomeLogOff = COA_INT
lib.welcomeLogOff {
 10 = COA
 10 {
  20 = TEXT
  20.typolink.parameter = 1
  20.typolink.returnLast = url
  20.wrap = <form id="logoutform" action="|" method="post">
  25 = TEXT
  25.wrap = Welcome 
  30 = COA
  30 {
   3 = TEXT
   3.data = TSFE:fe_user|user|username
   4 = TEXT
   4.value =  
   5 = TEXT
   5.value = Log off
   5.wrap = <a href="javascript:{}" onclick="document.getElementById('logoutform').submit(); return false;">|
   10 = TEXT
   10.value = <input type="hidden" name="logintype" value="logout" />
   20 = TEXT
   20.value = <input type="hidden" name="redirect_url" value="" />
   30 = TEXT
   30.value = </form>
  }
 }  
}

or simply:

Setup.TS


lib.logout {
 10 = TEXT
 10 {
  value = Logout
  typolink.parameter.data = TSFE:id
  typolink.additionalParams = &logintype=logout
 }
}

this snippet will create link to current page and add “logintype” variable (&logintype=logout) at the end. If you click on this link Typo3 will sign you out.

Extend felogin with custom markers

Setup:

Typo3 4.7.7
plugins:
– felogin
– myquizpoll

Setup.TS


plugin.tx_felogin_pi1.customMarkers {
 FEUSER_NUM_OF_POINTS {
  5 >
  5 = LOAD_REGISTER
  5 {
   current_uidvalue >
   current_uidvalue.cObject = CONTENT
   current_uidvalue.cObject {
    table = fe_users
    select {
     pidInList = 5
     recursive = 1
     where.wrap = username = '|'
     where.data = TSFE:fe_user|user|username
     orderBy = name ASC
    }
    renderObj = TEXT
    renderObj.field = uid
   }
   current_totalpoints >
   current_totalpoints.cObject = CONTENT
   current_totalpoints.cObject {
    table = tx_myquizpoll_result
    select {
     selectFields = COALESCE(SUM(tx_myquizpoll_category.tx_myquizbodovi_brbodova),0) AS suma
     leftjoin = tx_myquizpoll_category ON(tx_myquizpoll_category.uid=tx_myquizpoll_result.lastcat)
     where = tx_myquizpoll_result.fe_uid = ###current_uidvalue###
     pidInList = 5
     recursive = 1
     markers {
      current_uidvalue = TEXT
      current_uidvalue.data = register:current_uidvalue
     }
    }
    renderObj = TEXT
    renderObj.field = suma
   }
   current_dbg.cObject = CONTENT
   current_dbg.cObject {
    renderObj = TEXT
    renderObj.data = TSFE:fe_user|user|username
   }
  }
  10 = TEXT
  10.data = register:current_totalpoints
  10.wrap = |
  10.typolink.parameter = 50
 [usergroup=4]
  10.typolink.parameter = 203
 [global]
  10.if.value.data = register:current_totalpoints
  10.if.equals = 0
  15 = TEXT
  15.data = register:current_totalpoints
  15.wrap = |
  15.typolink.parameter = 50
 [usergroup=4]
  15.typolink.parameter = 203
 [global]
  15.if.value.data = register:current_totalpoints
  15.if.equals = 0
  15.if.negate = 1
 }
}